[Webkit-unassigned] [Bug 103725] getBBox() return wrong bounding box in <use> tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 7 08:48:33 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103725


Dirk Schulze <krit at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |krit at webkit.org




--- Comment #6 from Dirk Schulze <krit at webkit.org>  2012-12-07 08:51:00 PST ---
(In reply to comment #5)
> This exact issue has been discussed on www-svg before:
> http://lists.w3.org/Archives/Public/www-svg/2010Jan/0049.html
> 
> It all comes down to how x,y on <use> should be interpreted. I'd argue that Opera's behaviour is the most intuitive to authors, and is the behaviour our users have asked us for, on www-svg and elsewhere. Yes, the x,y does get treated as a transform in the generated shadowtree, but they're still x,y-attributes on the <use> element, and so it's reasonable to expect that they behave the same as every other x,y attribute pair (in other words: they affect the bbox of the element).

Philip did not quote the relevant section [1]:

""
In the generated content, the ‘use’ will be replaced by ‘g’, where all attributes from the ‘use’ element except for ‘x’, ‘y’, ‘width’, ‘height’ and ‘xlink:href’ are transferred to the generated ‘g’ element. An additional transformation translate(x,y) is appended to the end (i.e., right-side) of the ‘transform’ attribute on the generated ‘g’, where x and y represent the values of the ‘x’ and ‘y’ attributes on the ‘use’ element. The referenced object and its contents are deep-cloned into the generated tree.
""

This means x,y are used as transformation on the virtual g. The transform of an element does not contribute to its bounding box (but the parents bounding box). This is why Opera is wrong.

[1] http://www.w3.org/TR/SVG/struct.html#UseElement

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list