Closed Bug 1189042 Opened 9 years ago Closed 9 years ago

getBBox() on SVG <use> elements with x/y attributes returns wrong values

Categories

(Core :: SVG, defect)

39 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: connum, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

I had a problem with wrong positioning only in Firefox when using the GSAP JS library to animate SVGs. See this example codepen:
http://codepen.io/anon/pen/zGMKPN


Actual results:

The positioning of the elements was wrong as soon as they had been animated. This only occured in Firefox latest (at the time of writing 39, but I also reproduced this in an 38 ESR and 36), IE9,10,11, Chrome and Opera were displaying fine.


Expected results:

After some investigation from the GSAP developers, it turns out 'the issue has to do with a bug in the way Firefox reports getBBox() on <use> elements. It includes the "x" and "y" attributes in the computed value whereas other browsers don't.'

You can follow up the thread here:
http://greensock.com/forums/topic/12120-wrong-xy-positioning-in-firefox/#entry49823

GreenSock have kindly provided a check/fix that overwrites the getBBox() function if necessary, but this should be addressed in Firefox.
http://codepen.io/anon/pen/LVXBxY

By the way, this issue didn't occur in a Firefox 30, if that helps to narrow down the cause.
Can you produce a minimal testcase (something 10 lines long instead of 1000) that explicitly calls getBBox?

Narrowing down a regression range using moz-regression (http://mozilla.github.io/mozregression/) would also be helpful.
Flags: needinfo?(connum)
Regression range:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=9d8d16695f6a&tochange=b40296602083


Shigeyuki Tsukihashi — Bug 999964 part 1 - Patch for SVG 2 getBBox method; r=longsonr, r=bz
Blocks: 999964
Attached image testcase
I think we're returning the correct value (i.e. the value in current user space).

If you don't think that then you'd need to explain why you think that the rect in my testcase should include the x, y but the use should not.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(connum)
Resolution: --- → INVALID
Thanks for your fast response!
I think I'm not far enough into SVG in order to be able to do that, sorry. So if I understand correctly, you are suggesting that the other browsers are implementing the SVG spec wrong in this case? So I should file bug reports with MS, Google and Opera, then?
Flags: needinfo?(longsonr)
Feel free to either get the specification changed or file bug reports. Note that Opera uses the same rendering engine as Google so you wouldn't need to raise a separate bug report for it.
Flags: needinfo?(longsonr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: