Summary: | SVGMatrix.IDL methods do not conform to the specs | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> | ||||||||||
Component: | SVG | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | commit-queue, dino, rniwa, simon.fraser, thorton, webkit-bug-importer, zimmermann | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 191237, 196086 | ||||||||||||
Attachments: |
|
Description
Said Abou-Hallawa
2019-03-26 11:38:55 PDT
Created attachment 365978 [details]
Patch
Comment on attachment 365978 [details]
Patch
This needs a test (preferably a WPT so that we can share with other browsers).
Created attachment 366020 [details]
Patch
Created attachment 366022 [details]
Patch
(In reply to Simon Fraser (smfr) from comment #3) > Comment on attachment 365978 [details] > Patch > > This needs a test (preferably a WPT so that we can share with other > browsers). LayoutTests/svg/dom/SVGMatrix.html tests only the cases where invalid arguments are passed to the SVGMatrix methods. I cleaned the test and added few cases where valid arguments are passed. Notice that the new test passes in WebKit with and without this patch. SVGMatrix had two problems: -- The SVGMatrix.IDL was written incorrectly. -- The SVGMatrix methods were calling commitChange() even though the underlying SVGMatrixValue was not changing. (In reply to Said Abou-Hallawa from comment #6) > (In reply to Simon Fraser (smfr) from comment #3) > > Comment on attachment 365978 [details] > > Patch > > > > This needs a test (preferably a WPT so that we can share with other > > browsers). > > LayoutTests/svg/dom/SVGMatrix.html tests only the cases where invalid > arguments are passed to the SVGMatrix methods. I cleaned the test and added > few cases where valid arguments are passed. > > Notice that the new test passes in WebKit with and without this patch. > SVGMatrix had two problems: > > -- The SVGMatrix.IDL was written incorrectly. > -- The SVGMatrix methods were calling commitChange() even though the > underlying SVGMatrixValue was not changing. Do we mate Chrome/FF behavior on this new test? ^match Chrome and FF almost match the WebKit behavior. You can see these differences if you open LayoutTests/svg/dom/SVGMatrix.html in Chrome or FireFox. -- FireFox throws exceptions with all invalid attribute values or invalid arguments. -- The exceptions' messages in both FF and Chrome are different from the WebKit messages. -- The calculation for tan(90) in FF is different from WebKit and Chrome. Comment on attachment 366022 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366022&action=review > LayoutTests/svg/dom/SVGMatrix.html:110 > +shouldBeEqualToString("matrixToString(matrix.translate(10, 20))", "{ a: 2, b: 0, c: 0, d: 1, e: 20, f: 220}"); > +shouldBeEqualToString("matrixToString(matrix.scale(5))", "{ a: 10, b: 0, c: 0, d: 5, e: 0, f: 200}"); > +shouldBeEqualToString("matrixToString(matrix.scaleNonUniform(2, 3))", "{ a: 4, b: 0, c: 0, d: 3, e: 0, f: 200}"); > +shouldBeEqualToString("matrixToString(matrix.skewX(90))", "{ a: 2, b: 0, c: 32662478706390740, d: 1, e: 0, f: 200}"); > +shouldBeEqualToString("matrixToString(matrix.skewY(90))", "{ a: 2, b: 16331239353195370, c: 0, d: 1, e: 0, f: 200}"); Don't we need a test that's like: let matrix = { a: 2, b: 0, c: 0, d: 1, e: 0, f: 200} // or whatever matrix.scale(2) shouldBeEqualToString("matrixToString(matrix, "{ a: 10, b: 0, c: 0, d: 5, e: 0, f: 200}"); Comment on attachment 366022 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366022&action=review >> LayoutTests/svg/dom/SVGMatrix.html:110 >> +shouldBeEqualToString("matrixToString(matrix.skewY(90))", "{ a: 2, b: 16331239353195370, c: 0, d: 1, e: 0, f: 200}"); > > Don't we need a test that's like: > > let matrix = { a: 2, b: 0, c: 0, d: 1, e: 0, f: 200} // or whatever > matrix.scale(2) > shouldBeEqualToString("matrixToString(matrix, "{ a: 10, b: 0, c: 0, d: 5, e: 0, f: 200}"); Sorry but I do not understand your suggestion. Did you mean we need to confirm that matrix was not changed by the previous calls? If this is the case, the following statements already do that: debug(""); debug("Check that the matrix is still containing the correct values"); shouldBeEqualToString("matrixToString(matrix)", "{ a: 2, b: 0, c: 0, d: 1, e: 0, f: 200}"); Created attachment 366410 [details]
Patch
Comment on attachment 366410 [details] Patch Clearing flags on attachment: 366410 Committed r243703: <https://trac.webkit.org/changeset/243703> All reviewed patches have been landed. Closing bug. |