Closed Bug 891074 Opened 11 years ago Closed 10 years ago

Percentage values of transform-origin aren't respected for transforming SVG elements

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 923193

People

(Reporter: tophtucker, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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. http://tophtucker.com/icecreambug/


Expected results:

It should respect the percentage-valued transform-origin.
Attachment #772267 - Attachment mime type: text/plain → text/html
Issue with SVG display lists.
Setting svg.display-lists.painting.enabled=false fixes the bad rendering.

Regression range:
good=2012-08-02
bad=2012-08-03
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=588424024294&tochange=89dcadd42ec4

Jonathan Watt — Bug 776054 - Flip the prefs to enable the use of display lists for SVG painting and hit-testing. r=roc.
Blocks: 776054
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Version: 22 Branch → 17 Branch
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.)
In the good build, I see that: http://i.imgur.com/KE9BbNc.jpg
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.
No longer blocks: 776054
Keywords: regression
OS: Mac OS X → All
Hardware: x86 → All
Version: 17 Branch → Trunk
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:
http://hansmuller-webkit.blogspot.com/2012/03/css-transform-origin-coming-to-svg.html
Thanks, that is a helpful link regarding the implementation decisions made for webkit.
Blocks: 779683
Depends on: 1013421
No longer depends on: 1013421
I assume that this issue is also causing the behavior here? http://jsfiddle.net/kMZnW/ ?
Marking this as a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=923193, yeah?
Depends on: 923193
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.