Only include position once in foreign object client rects
SVG's foreign object coordinate spaces were recently updated [1] to clarify SVG coordinates vs HTML coordinates. SVG coordinates are equal to HTML coordinates plus location (x and y). LayoutSVGBlock's MapLocalToAncestor takes HTML coordinates and offsets by location. Element::ClientQuads passed ObjectBoundingBox, which is in SVG coordinates and includes location, to MapLocalToAncestor which would apply the location offset twice. This patch updates Element::ClientQuads to use AbsoluteQuads which correctly calculates the foreign object bounds. Two TODOs have been added: 1) Element::ClientQuads and Element::BoundsInViewport are very similar and should be unified. 2) It's not clear whether stroke should be included in Element::ClientQuads. If it should be, SVG special-cases can be removed from Element::ClientQuads. A spec question has been filed: https://github.com/w3c/svgwg/issues/339. [1] https://chromium.googlesource.com/chromium/src/+/09a6cd640fb5bf07aa06477362229c2e6969a718 Bug: 741615 Change-Id: Ibec65966e8661c4c2390284708ef53b5d0c1d11a Reviewed-on: https://chromium-review.googlesource.com/597487 Commit-Queue: Philip Rogers <pdr@chromium.org> Reviewed-by:Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#491875}
Showing
Please register or sign in to comment