Bug 232189

Summary: Fix issue for transform-origin in SVG
Product: WebKit Reporter: Nikos Mouchtaris <nmouchtaris>
Component: SVGAssignee: Nikos Mouchtaris <nmouchtaris>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, darin, dino, ews-watchlist, fmalita, gyuyoung.kim, jonlee, pdr, sabouhallawa, schenney, sergio, simon.fraser, webkit-bug-importer, youennf, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
simon.fraser: review+
Fix for transform-origin in svg
none
Fix for transform-origin in svg none

Description Nikos Mouchtaris 2021-10-22 17:53:52 PDT
Fix issue for transform-origin in SVG
Comment 1 Nikos Mouchtaris 2021-10-22 17:54:43 PDT
rdar://84516016
Comment 2 Nikos Mouchtaris 2021-10-22 18:02:25 PDT
Created attachment 442235 [details]
Patch
Comment 3 Darin Adler 2021-10-23 22:32:42 PDT
Comment on attachment 442235 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442235&action=review

> Source/WebCore/ChangeLog:3
> +        Fix issue for transform-origin in SVG

If this fixes an issue, that I expect to see a test, or a change in the expected results for an existing test
Comment 4 Nikos Mouchtaris 2021-10-25 12:34:23 PDT
Created attachment 442401 [details]
Patch
Comment 5 EWS Watchlist 2021-10-25 12:35:28 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 6 Simon Fraser (smfr) 2021-10-25 13:02:45 PDT
Comment on attachment 442401 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442401&action=review

r+ but the test needs fixing.

> Source/WebCore/ChangeLog:3
> +        Fix issue for transform-origin in SVG

This should be more specific, like "transform-origin attribute ignored when using transform attribute in SVG"

> Source/WebCore/ChangeLog:8
> +        Add stopgap for C to use transform-origin in SVGGraphicsElement::animatedLocalTransform.

Need to revise this.

> Source/WebCore/ChangeLog:9
> +        Better fix making transform a presentation attribute coming later.

You could link to the bugzilla bug.

> Source/WebCore/svg/SVGGraphicsElement.cpp:107
> +        matrix.translate(-t.x(), -t.y());

Does translate(-t) work?

> LayoutTests/imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style.svg:11
> +    <rect x="0" y="0" width="40" height="10" style="fill:cyan" transform="scale(2, 3)" transform-origin="30px 10px"/>

I think in the attribute you specify the transform-origin without units. Use fill="green" other than cyan fill.

> LayoutTests/platform/glib/imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style-expected.txt:1
> +layer at (0,0) size 800x600

These .txt files should not exist. The problem is that webkit testing doesn't find transform-origin-not-explicit-style-ref.svg as the ref (it would have to be named transform-origin-not-explicit-style-expected.svg); see webkit.org/b/203784
Comment 7 Nikos Mouchtaris 2021-10-25 13:27:35 PDT
Created attachment 442404 [details]
Fix for transform-origin in svg
Comment 8 Nikos Mouchtaris 2021-10-25 15:34:41 PDT
Created attachment 442430 [details]
Fix for transform-origin in svg
Comment 9 EWS 2021-10-25 18:44:46 PDT
Committed r284853 (243530@main): <https://commits.webkit.org/243530@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442430 [details].