RESOLVED WORKSFORME 201854
transform presentation attribute seems to ignore transform-origin
https://bugs.webkit.org/show_bug.cgi?id=201854
Summary transform presentation attribute seems to ignore transform-origin
Dirk Schulze
Reported 2019-09-16 18:28:08 PDT
The transform presentation attribute on SVG elements seems to ignore the transform-origin property. Here an example of transform attribute and transform-origin: https://codepen.io/krit/pen/KKPxagO Here an example of transform property and transform-origin: https://codepen.io/krit/pen/eYOLgBp The second one does not show any red and works correctly. The first one seems to ignore the settings of transform-origin. I think that this is a regression and did work before. However, I can not confirm it right now.
Attachments
examples of usages of SVG transform-origin attribute (20.79 KB, text/html)
2021-04-19 04:30 PDT, Maxim Kulikov
no flags
Reference Image for transform-origin (97.69 KB, image/png)
2022-01-12 11:16 PST, attley
no flags
Radar WebKit Bug Importer
Comment 1 2019-09-17 13:12:24 PDT
Maxim Kulikov
Comment 2 2021-04-19 04:23:33 PDT
I can confirm that the bug is reproduced in Safari versions 14.0.3, 13.1.2 and 12.1.2. I didn't test it on earlier versions. It seems like transform-origin SVG attribute is applied only to transformations defined in transform CSS property, but not in transform SVG attribute. For example, this is rendered incorrectly <g transform="scale(0.75 0.75)" transform-origin="100 100">...</g> while this is rendered correctly <g style="transform: scale(0.75, 0.75);" transform-origin="100 100">...</g> Here is a more demonstrative example of the bug: https://maxlk.github.io/svg-transform-origin-attribute/
Maxim Kulikov
Comment 3 2021-04-19 04:30:45 PDT
Created attachment 426406 [details] examples of usages of SVG transform-origin attribute All images on the page should look the same as the image from Figure 1. Currently, images from sections 2 and 4 are rendered incorrectly.
Martin Robinson
Comment 4 2021-12-13 05:44:41 PST
All images look the same to me now, so I think this problem has been fixed.
attley
Comment 5 2022-01-12 11:16:28 PST
Created attachment 448972 [details] Reference Image for transform-origin Figure 3. should look exactly the same as the reference image in Figure 2. It does not look like the reference image in Figure 2.
attley
Comment 6 2022-01-12 11:17:49 PST
This issue does not appear to be fixed as the previous commenter suggests. Please let me know if I can do anything else to help.
Martin Robinson
Comment 7 2022-01-13 16:30:33 PST
(In reply to attley from comment #5) > Created attachment 448972 [details] > Reference Image for transform-origin > > Figure 3. should look exactly the same as the reference image in Figure 2. > > It does not look like the reference image in Figure 2. What test case is this screenshot of? It looks different to me than the one listed above in the attachments. Additionally, what version of Safari are you testing with?
attley
Comment 8 2022-01-13 16:55:52 PST
Hi Martin, I'm using Safari 15.1. The attachment that I added is a screenshot of my Safari browser (v15.1) rendering this page: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin Specifically the HTML Example section: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin#example Unless I'm reading the docs on that page incorrectly - it says that 'Figure 3. transform-origin used. This image should look exactly the same as the reference image in Figure 2.' As you can see from my attached screenshot it does not look like the reference image in Figure 2. So something is not working. The original attachment from Maxim is a screenshot of a demo that it looks like they created, which can be found here: https://maxlk.github.io/svg-transform-origin-attribute/ Thanks!
Simon Fraser (smfr)
Comment 9 2022-01-13 17:18:07 PST
Please try STP 137. With that, https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin shows correct rendering.
attley
Comment 10 2022-01-14 07:55:12 PST
(In reply to Simon Fraser (smfr) from comment #9) > Please try STP 137. With that, > https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin > shows correct rendering. Hi Simon, What do you mean by STP 137? Thx.
Martin Robinson
Comment 11 2022-01-14 08:18:23 PST
(In reply to attley from comment #10) > What do you mean by STP 137? STP is the Safari Technology Preview which can be downloaded from Apple's site: https://developer.apple.com/safari/technology-preview/
Note You need to log in before you can comment on or make changes to this bug.