This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30097 - return DOMPoint or DOMPointReadOnly accordingly, from matrixTransform method?
Summary: return DOMPoint or DOMPointReadOnly accordingly, from matrixTransform method?
Status: RESOLVED MOVED
Alias: None
Product: FXTF
Classification: Unclassified
Component: Geometry (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: sideshowbarker+geometry
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-23 19:34 UTC by Joe Pea
Modified: 2018-04-15 17:47 UTC (History)
2 users (show)

See Also:


Attachments

Description Joe Pea 2017-04-23 19:34:50 UTC
https://drafts.fxtf.org/geometry/#ref-for-dom-dompointreadonly-w-1

[[
    DOMPoint matrixTransform(optional DOMMatrixInit matrix);
]]

Why not return DOMPoint or DOMPointReadOnly accordingly?

For example, when implemented in JavaScript, then instead of

```
matrixTransform(matrix) {
  let result = new DOMPoint(this)
}
```

we would write

```
matrixTransform(matrix) {
  let result = new this.constructor(this)
}
```

so that it picks the right constructor.
Comment 1 Joe Pea 2017-04-23 19:36:23 UTC
Oh, and I am missing the rest of the implementation in those examples, just showing that we can create a new matrix based on which class is being used.
Comment 2 Simon Pieters 2017-05-04 22:34:26 UTC
We could, but why?

Note that DOMMatrixReadOnly's immutable transformation methods also return DOMMatrix rather than DOMMatrixReadOnly.
Comment 3 Dirk Schulze 2018-04-15 17:47:40 UTC
https://github.com/w3c/fxtf-drafts/issues/275