[Webkit-unassigned] [Bug 138033] New: getBoundingClientRect on elements inside an SVG with non-default viewBox is incorrect
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 23 17:39:15 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=138033
Bug ID: 138033
Summary: getBoundingClientRect on elements inside an SVG with
non-default viewBox is incorrect
Classification: Unclassified
Product: WebKit
Version: 528+ (Nightly build)
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: CSS
Assignee: webkit-unassigned at lists.webkit.org
Reporter: mmfrezabakhshi at yahoo.co.uk
Created attachment 240380
--> https://bugs.webkit.org/attachment.cgi?id=240380&action=review
minimal html page
in the attached html page there are two similar SVG elements, one is zoomed (by setting its viewbox set to 4 times the size of actual svg) and the other one normal (its viewbox the same size as the SVG).
the RECT element inside "zoomed" SVG reports its "getBoundingClientRect" the same as the "normal" one despite the fact that the are in different locations on relative to the page.
they both report "111" as their "left" which is "100 translate + 1pixel border of SVG + 9px padding of body + 1px border of body).
the expected value for the zoomed one is 61 which is:
100/2 = 50 pixel position of RECT inside SVG
1px border size of SVG
9px padding of body
1px border of body
which makes it 61px.
this also results in wrong behaviour of Safari websinpector! if you hover the mouse over RECT in zoomed SVG in "elements" panel of webinspector to highlight the actual element, it displays a wrong spot on the page.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141024/55615d65/attachment-0002.html>
More information about the webkit-unassigned
mailing list