Closed Bug 874828 Opened 11 years ago Closed 11 years ago

svg.getBoundingClientRect() incorrect with non-default viewBox or transform

Categories

(Firefox :: General, defect)

21 Branch
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 530985

People

(Reporter: herr.ernst, Unassigned)

Details

Attachments

(1 file)

When using inline SVG in HTML5 and setting a viewBox attribute for the SVG element so its contents gets panned/zoomed, getBoundingClientRect() does not return the actual size of the element, but the transformed size of the svg canvas. The same behaviour is triggered when the content of the svg is transformed via a transform attribute (second example in testcase). This also has effect on the Web Developer tools, if you inspect the svg elements in the attached test case, you see that the outline around the svg element is larger than the element itself, and the values of getBoundingClientRect() are also used in the display of the box model metrics and 3D view.

IE 9, IE 10, Chrome (27), Opera (12.14), Safari (6.0.4) all report the size of the element (see test case).
Attachment #752663 - Attachment mime type: text/plain → text/html
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: