New issue
Advanced search Search tips

Issue 716711 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

SVG matrixTransform worked in v57 wrong answer it v58

Reported by v...@g.nevcal.com, Apr 29 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

Steps to reproduce the problem:
1. View the file in Chromium 58
2. 
3. 

What is the expected behavior?
Curve and line at bottom should tilt up to the right, instead of down to the right, and are too long.

What went wrong?
Apparently something is wrong with the matrixTransform that converts from SVG user coordinates to browser pixels.

Works in every current version of FF on any channel and bitness (v53, v54)

Works in Opera 44 based on Chromium 57. Works in Chrome 57. Fails in Chrome & Chromium 58 and Chrome Canary 60.

Fails on M$ browsers because they lack a feature I'm using.

Did this work before? Yes 57

Does this work in other browsers? Yes

Chrome version: Version 58.0.3029.81 (64-bit)  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0
 
chrome-svg-test.html
4.8 KB View Download

Comment 1 by f...@opera.com, May 1 2017

Labels: Needs-Bisect M-58
Status: Untriaged (was: Unconfirmed)
I don't see anything wrong with matrixTransform, however it seems that one of the getScreenCTM calls (et) returns unexpected/incorrect results (looks like box position is incorrect.) Calling getScreenCTM on the same element in Devtools after the test has run appears to give a more reasonable matrix though, so maybe something awry with the layout during load... A bisect might help there.
Labels: -Needs-Bisect RegressionFound-58 RegressedIn-58 OS-Android OS-Chrome OS-Linux OS-Mac
Owner: f...@opera.com
Status: Assigned (was: Untriaged)
Regression range is 

https://chromium.googlesource.com/chromium/src/+log/c5b606c3188dac60dd3f8e29bafbb90d95089c3e..5ae55b8c8ed39e3a1019afba988b5df208f53420

of which this is probably it:

https://chromium.googlesource.com/chromium/src/+/2ad2a9bf7205ec77843cf27a7964fda92df386b2
Labels: BugSource-User PaintTeamTriaged-20170501
Labels: -Pri-2 -M-58 ReleaseBlock-Stable M-59 Pri-1

Comment 5 by f...@opera.com, May 2 2017

Oh, this is the <use> local space "duality" rearing its ugly head (again)... *sigh*

Comment 6 by f...@opera.com, May 2 2017

Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, May 2 2017

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

commit 9acc325d119247a27d0a007d56fc6cc2fa23edc7
Author: fs <fs@opera.com>
Date: Tue May 02 16:05:32 2017

getScreenCTM on <use> should not include the additional translation

This is a partial revert of https://codereview.chromium.org/2711503002,
preserving the fix from that bug ( crbug.com/678167 ) while restoring the
LocalCoordinateSpaceTransform() infrastructure to compute the correct
CTM for <use> elements.

BUG= 716711 

Review-Url: https://codereview.chromium.org/2853223002
Cr-Commit-Position: refs/heads/master@{#468657}

[add] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/LayoutTests/svg/dom/getscreenctm-use-with-additional-translation.html
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGElement.cpp
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGElement.h
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGPatternElement.cpp
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGPatternElement.h
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[modify] https://crrev.com/9acc325d119247a27d0a007d56fc6cc2fa23edc7/third_party/WebKit/Source/core/svg/SVGSVGElement.h

Comment 8 by v...@g.nevcal.com, May 2 2017

Where can I learn more about the '<use> local space "duality"' issues?

Comment 9 by v...@g.nevcal.com, May 2 2017

Is there a similar "duality" issue regarding nested <svg>?  Chrome gives a getScreenCTM that reflects the inside of the nested <svg>... Firefox gives getScreenCTM that reflects the outside of the nested <svg>... for the placement of the SVG itself, and has rejected several tickets to change it, claiming their interpretation conforms to the standard.

Comment 10 by f...@opera.com, May 3 2017

Labels: Merge-Request-59
The "duality" is an implementation thing (headache) that revolves around whether or not the 'x' and 'y' on a <use> should be included in the local space transform (or CTM.) So in particular case we had included it when we shouldn't have.

As for nested <svg> I guess that comes down to whether or not the 'viewBox' (and 'preserveAspectRatio' effects) should be included? In SVG 1.1 that wasn't particularly well-defined [1], but based on the SVG2 wording [2] I'd say it should. (I would probably have argued that the "current user units" in this case ought to have been with the 'viewBox' included, but it's also said about 'viewBox' that: "If specified, an additional transformation is applied to all descendants of the given element to achieve the specified effect.")
It'd be interesting to also check what Edge does in this case.

[1] https://www.w3.org/TR/SVG11/types.html#__svg__SVGLocatable__getScreenCTM
[2] https://svgwg.org/svg2-draft/types.html#__svg__SVGGraphicsElement__getScreenCTM
Project Member

Comment 11 by sheriffbot@chromium.org, May 3 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 12 by bugdroid1@chromium.org, May 3 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/351c73cdc0a9a1e1391893f1b44f40e419950b9f

commit 351c73cdc0a9a1e1391893f1b44f40e419950b9f
Author: Fredrik Söderquist <fs@opera.com>
Date: Wed May 03 07:55:39 2017

getScreenCTM on <use> should not include the additional translation

This is a partial revert of https://codereview.chromium.org/2711503002,
preserving the fix from that bug ( crbug.com/678167 ) while restoring the
LocalCoordinateSpaceTransform() infrastructure to compute the correct
CTM for <use> elements.

BUG= 716711 

Review-Url: https://codereview.chromium.org/2853223002
Cr-Commit-Position: refs/heads/master@{#468657}
(cherry picked from commit 9acc325d119247a27d0a007d56fc6cc2fa23edc7)

Review-Url: https://codereview.chromium.org/2857863003 .
Cr-Commit-Position: refs/branch-heads/3071@{#370}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[add] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/LayoutTests/svg/dom/getscreenctm-use-with-additional-translation.html
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGElement.cpp
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGElement.h
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGPatternElement.cpp
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGPatternElement.h
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[modify] https://crrev.com/351c73cdc0a9a1e1391893f1b44f40e419950b9f/third_party/WebKit/Source/core/svg/SVGSVGElement.h

Comment 13 by f...@opera.com, May 3 2017

Status: Fixed (was: Started)

Comment 14 by v...@g.nevcal.com, May 3 2017

Thanks for the explanations of duality and nested SVG. I've used "canned" SVG stuff in the past, but in getting into generating my own, I'm finding there are lots of edge cases or vaguely defined stuff in the 1.1 spec, and it doesn't help that the current implementations also include some of 2.0 (except they are nice features, I would applaud further implementation of 2.0) which in some cases, like you point out, either "clarifies" or "changes" the way one should interpret the 1.1 spec.

And thanks for the fix, I'll try it out once the build includes it, but your explanation certainly fits with the offset my test case was experiencing.
Labels: TE-Verified-M59 TE-Verified-59.0.3071.47
Verified this issue on Windows 10, Ubuntu 14.04 and Mac 10.12.4 with chrome #59.0.3071.47 with provided html file in comment #0

Observed that curve and line at bottom should tilt up to the right.

Hence adding TE-Verified labels.
Issue 716711-M59-Good.png
68.8 KB View Download
Issue 716711-M58-Bad.png
65.1 KB View Download
I still have this issue in Chrome version 59.0.3071.115  in Mac OS 12.5
The getCTM and matrixTransform still exists?

Comment 17 by f...@opera.com, Jul 21 2017

#16, please file a new bug and we'll take a look at it (also note that getScreenCTM != getCTM.)

Sign in to add a comment