New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 741615 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression
Team-Blink-Paint



Sign in to add a comment

Chrome59 specific : getBoundingClientRect reports different dimensions for foreignObject in SVG element

Reported by manoj.sa...@comprotechnologies.com, Jul 12 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
1. Create an HTML document.
2. Add an `svg` child element to its body
3. Add a `foreignObject` child element to the `svg` element.
5. Add x and y attributes to foreignObject with some value.
6. Attempt to get dimensions of foreignObject element by invoking its `getBoundingClientRect` in chrome 59 and chrome 58.

Note that before setting x and y attributes to foreignObject Element, Returned object by getBoundingClientRect are same in both chrome 59 and 59.

chrome 58 details:
version: 58.0.3029.96 (Official Build) (32-bit)
Revision: 2a03c99a5f45c6d507af8eb2345ad68a565d1518-refs/branch-heads/3029@{#787}
OS: Windows
JavaScript: V8 5.8.283.37
Flash: 26.0.0.137
User Agent: Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36

What is the expected behavior?
behavior of foreignObjectEle.getBoundingClientRect() and Returned DOMRect object should be same should be same in  both chrome 59 and  chrome 58

What went wrong?
The x and y attributes of foreignObject ( https://www.w3.org/TR/SVG/extend.html ) might not be getting properly assigned.

Did this work before? Yes 58.0.3029.96

Chrome version: 59.0.3071.115  Channel: stable
OS Version: 10.0
Flash Version: 26.0.0.131
 
test.html
2.7 KB View Download
Screenshot_chrome58.png
46.4 KB View Download
Screenshot_chrome59.png
42.1 KB View Download

Comment 1 by junov@chromium.org, Jul 12 2017

Components: -Blink Blink>SVG Blink>Geometry

Comment 2 by f...@opera.com, Jul 12 2017

Labels: Needs-Bisect
Status: Untriaged (was: Unconfirmed)
Looks a bit like the inverse of the scale from the 'transform' is applied...

Comment 3 by f...@opera.com, Jul 12 2017

Trying to bisect between 58.0.3029.96 and 59.0.3071.115 I get the same result in both as in the 59 screenshot. This was not on Windows though, so hopefully someone can attempt to bisect there.
Cc: sandeepkumars@chromium.org
Labels: -Pri-2 -Needs-Bisect hasbisect-per-revision OS-Linux OS-Mac Pri-1
Owner: wangxianzhu@chromium.org
Status: Assigned (was: Untriaged)
Able to reproduce the issue using #59.0.3071.115 on Win 10, Mac 10.12.5 and Linux Ubuntu 14.04

Using the per-revision bisect providing the bisect results,

Good build: 57.0.2937.0 (Revision: 435110).
Bad build:  57.0.2938.0 (Revision: 435514).

You are probably looking for a change made after 435336 (known good), but no later than 435337 (first known bad).

CHANGELOG URL
---------------
https://chromium.googlesource.com/chromium/src/+log/6003cf9974cf584ae8523e02a0bc001178fb73ae..f451d9b5de5a1b4691d60d8c74341ac8a466cf57

From the CL above, assigning the issue to the concern owner

@wangxianzhu: Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to concern owner.

Review-Url: https://codereview.chromium.org/2536493002


Thanks.
Labels: M-61
Issue is seen in M61 as well.
Owner: schenney@chromium.org
I'm pretty sure that blamed patch was reverted. I'll look into that as soon as I get a chance, which should be sooner than wangxianzhu@ can look at it.
A gentle Reminder, As this is blocking application.
Cc: wangxianzhu@chromium.org
Owner: pdr@chromium.org
pdr@, this is the foreign object geometry bug I was talking about.

Comment 10 by pdr@chromium.org, Jul 31 2017

Minimized repro

We're counting the x and y offsets twice.
fo.html
434 bytes View Download
Project Member

Comment 11 by bugdroid1@chromium.org, Aug 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8e4d4abfb281a12d5e972e8d8edec3d5db53fcac

commit 8e4d4abfb281a12d5e972e8d8edec3d5db53fcac
Author: pdr <pdr@chromium.org>
Date: Thu Aug 03 23:26:08 2017

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}
[modify] https://crrev.com/8e4d4abfb281a12d5e972e8d8edec3d5db53fcac/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/8e4d4abfb281a12d5e972e8d8edec3d5db53fcac/third_party/WebKit/Source/core/dom/ElementTest.cpp

Comment 12 by pdr@chromium.org, Aug 8 2017

Status: Fixed (was: Assigned)

Sign in to add a comment