Last Comment Bug 891074 - Percentage values of transform-origin aren't respected for transforming SVG elements
: Percentage values of transform-origin aren't respected for transforming SVG e...
Status: RESOLVED DUPLICATE of bug 923193
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Jet Villegas (:jet)
Depends on: 923193
Blocks: 779683
  Show dependency treegraph
Reported: 2013-07-08 12:55 PDT by tophtucker
Modified: 2014-06-30 14:22 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

transformoriginbug.html (5.02 KB, text/html)
2013-07-08 12:55 PDT, tophtucker
no flags Details

Description User image tophtucker 2013-07-08 12:55:42 PDT
Created attachment 772267 [details]

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36

Steps to reproduce:

Scaled down a group in an SVG graphic by transform:scale(x,y) and changed the transform-origin to 50% 100% (center bottom).

(I've tried in Firefox 22 and Aurora 24.0a2.)

Actual results:

Firefox appears to not heed any percentage values for transform-origin, only pixel values — even though in the inspector it claims to have the right values.

This also happens in Webkit, but is fixed (bizarrely) by "font-size: 100%;" being applied to a parent element of the graphic (html, body, or svg) in a linked stylesheet.

Expected results:

It should respect the percentage-valued transform-origin.
Comment 1 User image Loic 2013-07-09 06:54:08 PDT
Issue with SVG display lists.
Setting svg.display-lists.painting.enabled=false fixes the bad rendering.

Regression range:

Jonathan Watt — Bug 776054 - Flip the prefs to enable the use of display lists for SVG painting and hit-testing. r=roc.
Comment 2 User image Jonathan Watt [:jwatt] 2013-07-09 06:57:50 PDT
Without SVG display lists we won't support CSS transforms on SVG at all. Does the testcase really work correctly in your "good" build, or did the behavior between "good" and "bad" just change? (Which would be expected.)
Comment 3 User image Loic 2013-07-09 07:04:52 PDT
In the good build, I see that:
Comment 4 User image Jonathan Watt [:jwatt] 2013-07-09 07:16:32 PDT
I can see why you thought that this was a regression since at first that rendering may seem to be what you'd expect. That happens to be the rendering that you get if you completely remove the style rule though, which is what you'll get prior to bug 776054 when CSS transforms couldn't apply to SVG.

The actual difference between the Nightly rendering and what should be rendered is that the ice cream should be reduced in height by half, but the bottom should stay where it is rather than the top.

So this isn't a regression, but rather a buggy/incomplete feature. Thanks for checking old builds all the same, Loic.
Comment 5 User image tophtucker 2013-07-09 23:24:58 PDT
Thanks for taking a look guys — sorry my test case didn't make it super clear what the "correct" rendering is, but Jonathan, that sounds right. Guess it's not a bug, just not implemented yet.

If it helps, here's Hans Muller's post on bringing CSS transform-origin to SVG on WebKit:
Comment 6 User image Jonathan Watt [:jwatt] 2013-07-10 01:13:22 PDT
Thanks, that is a helpful link regarding the implementation decisions made for webkit.
Comment 7 User image Dirk Schulze 2014-05-21 02:17:08 PDT
I assume that this issue is also causing the behavior here? ?
Comment 8 User image tophtucker 2014-05-28 19:36:26 PDT
Marking this as a duplicate of, yeah?
Comment 9 User image Robert Longson 2014-05-29 22:55:21 PDT

*** This bug has been marked as a duplicate of bug 923193 ***

Note You need to log in before you can comment on or make changes to this bug.