Open Bug 1346399 Opened 7 years ago Updated 2 years ago

Update Geometry interfaces and impl (DOMMatrix, DOMMatrixReadOnly, WebkitCSSMatrix) to latest spec

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

People

(Reporter: xlai, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36



Actual results:

Firefox has finished implemented and shipped DOMMatrix (https://bugzilla.mozilla.org/show_bug.cgi?id=1018497) and other Geometry interfaces about 2 years ago.

But now the Geometry interfaces spec (https://drafts.fxtf.org/geometry/) has gone through some changes recently (https://drafts.fxtf.org/geometry/#changes). This include structured cloning as well as new constructors to *ReadOnly interfaces. 


Expected results:

To achieve conformance with other browsers like Chrome, it would be better to update these implementation to match the latest spec.
Hmm...  This API got changed in incompatible and undetectable ways (see rotate() and rotateSelf()).  Brian, do you know why that happened or who might know, and how browsers and pages are expected to deal with this?  Who on our side was involved in this working group?
Flags: needinfo?(bbirtles)
It looks like that was part of a change Simon made to provide WebKitCSSMatrix compatibility.[1] I don't think any WG discussed this but Simon did mail public-fx.[2][3] Unfortunately not many people watch public-fx so it's easy for these things to fall through the cracks. On our side, Simon did CC roc and Mike Taylor and I believe Mike reviewed the changes[4]. Mike do you know what the story is here? Is no-one using rotate() such that we're free to change the meaning of the arguments?

[1] https://github.com/w3c/fxtf-drafts/commit/430bc88c806091a93aa51a4a3f6c04be7639aa2e
[2] https://lists.w3.org/Archives/Public/public-fx/2015OctDec/0050.html
[3] https://lists.w3.org/Archives/Public/public-fx/2016JanMar/0016.html
[4] https://github.com/whatwg/compat/issues/19#issuecomment-173936532
Flags: needinfo?(bbirtles) → needinfo?(miket)
httparchive for "DOMMatrix"

SELECT * FROM (
SELECT page, url, REGEXP_EXTRACT(body, r'(.{50}\bDOMMatrix(?:ReadOnly?)\b.{100})') AS match
FROM [httparchive:har.2017_01_15_chrome_requests_bodies]
) WHERE match != "null"

Row	page	url	match	 
1	http://www.withsix.com/	https://withsix2.azureedge.net/legacy/dart-uuid.js	tem|DOMFileSystemSync|DOMImplementation|DOMMatrix|DOMMatrixReadOnly|DOMParser|DOMPoint|DOMPointReadOnly|DOMStringMap|DataTransfer|Database|DeprecatedStorageInfo|Deprec	 
2	http://www.devdocs.io/	http://docs.devdocs.io/dom/index.json?1475434383	Matrix","path":"dommatrix","type":"DOM"},{"name":"DOMMatrixReadOnly","path":"dommatrixreadonly","type":"DOM"},{"name":"DOMParser","path":"domparser","type":"DOM"},{"na	 
3	http://www.devdocs.io/	http://devdocs.io/docs/dom/index.json?1475434383	Matrix","path":"dommatrix","type":"DOM"},{"name":"DOMMatrixReadOnly","path":"dommatrixreadonly","type":"DOM"},{"name":"DOMParser","path":"domparser","type":"DOM"},{"na

None of these seem to actually use DOMMatrix (and no match for rotate/rotateSelf in these resources).


https://nerdydata.com/search?table=deepweb&query=DOMMatrix

No Results Found


https://github.com/search?l=javascript&q=dommatrix+rotate+NOT+test+NOT+polyfill&ref=searchresults&type=Code&utf8=✓

8 results, none of which look problematic for the rotate/rotateSelf change.


As bz pointed out in blink-dev, the change is detectable by checking DOMMatrix.prototype.rotate.length.

An alternative check that doesn't depend on semantic assumptions from the optionalness of the first argument:

function supportsNewRotate() {
  return !(new DOMMatrix().rotateSelf(1, 1, 1).is2D);
}
That makes it plausible that we could change the behavior here, at least...
Looks like Simon answered for me -- thanks!
Flags: needinfo?(miket)
Status: UNCONFIRMED → NEW
Component: DOM: Core & HTML → DOM: CSS Object Model
Ever confirmed: true
Note that I think we're about to ship in blink (after a few tweaks): https://groups.google.com/a/chromium.org/d/msg/blink-dev/cAiTOdSGyes/DjfaZAZMCQAJ

Please let us know if you think we're making a mistake, this one seems quite messy with non-obvious trade offs but probably also urgent :-(
There's a bunch of status about the changes in:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/cAiTOdSGyes/zmwpC2VTAQAJ
(but also see other messages in the long thread).
Summary: Update Geometry interfaces and impl to latest specs → Update Geometry interfaces and impl (DOMMatrix, DOMMatrixReadOnly, WebkitCSSMatrix) to latest spec
Depends on: 1427721
I did part of this in bug 1186265.
Priority: -- → P3

Kagami, is there anything left to do here, do you know?

Flags: needinfo?(saschanaz)
Flags: needinfo?(saschanaz)

Ah, I see, bug 1562214.

Depends on: 1562214
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.