[Webkit-unassigned] [Bug 46203] New: getClientRects()[0] != getBoundingClientRect()
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 21 11:24:41 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=46203
Summary: getClientRects()[0] != getBoundingClientRect()
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
URL: http://bl.ocks.org/590163
OS/Version: Mac OS X 10.6
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: SVG
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: mbostock at cs.stanford.edu
CC: zimmermann at kde.org
Created an attachment (id=68265)
--> (https://bugs.webkit.org/attachment.cgi?id=68265)
CSSOM-SVG test case.
According to CSSOM View 7.1, getClientRects():
"""
If the element does not have an associated CSS layout box and is in the http://www.w3.org/2000/svg namespace return a ClientRectList object containing a single ClientRect object that describes the bounding box of the element as defined by SVG specification.
"""
The expected behavior of getClientRects() is that it return a single-element array containing the "tight bounding box ... on the geometry of all contained graphics elements" per SVGLocatable.getBBox. The value of svg.getClientRects()[0] should therefore equal svg.getBBox(). Furthermore, svg.getClientRects()[0] should equal svg.getBoundingClientRect(), per CSSOM "Otherwise, return a ClientRect object describing the smallest rectangle that includes the first rectangle in list and all of the remaining rectangles of which the height or width is not zero."
However, the actual behavior of getClientRects() is that it returns a single-element array with the size of the SVG container.
This is partly a regression from Safari 5, where getClientRects()[0] and getBoundingClientRect() were consistent. However, in Safari 5 the returned value did not equal getBBox(). Firefox (3.6 & 4) arguably does not pass this test, either. For Firefox getBoundingClientRect() and getClientRects()[0] are equal, but slightly larger than the value of getBBox(), perhaps because of padding / margin / borders. Opera exhibits the opposite behavior of WebKit nightlies: it returns the correct value for getBoundingClientRect(), but the SVG container size for getClientRects()[0].
--
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