SVG text CSS transform: translate erroneously takes zoom level into account
Reported by
tim.dep...@zentrick.com,
Nov 15 2016
|
||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36 Example URL: https://jsfiddle.net/39252wpu/6/ Steps to reproduce the problem: 1. Position SVG <text> using CSS transform: translate. 2. Change zoom level from 100%. 3. Compare to equivalent <text transform>. What is the expected behavior? CSS transform and SVG transform should produce identical results. What went wrong? CSS transform multiplies absolute coordinates by zoom level. E.g., in the fiddle, `transform: translate(0, 50px)` with a zoom level of 200% is interpreted as `transform: translate(0, 100px)`. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 54.0.2840.100 Channel: stable OS Version: Flash Version: Shockwave Flash 23.0 r0 Firefox produces the expected rendering at every zoom level. Additionally, --force-device-scale-factor doesn't break things.
,
Dec 12 2016
There are a few issues that are around text being mispositioned under zoom when the text has a transform attribute. The commit responsible seems to be r434934. I'm including my TC here as requested on issue 673114 .
,
Dec 12 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/12ed8948ab2de41a58831f3093f8c5ca6f997493 commit 12ed8948ab2de41a58831f3093f8c5ca6f997493 Author: fs <fs@opera.com> Date: Mon Dec 12 22:12:57 2016 Perform "zoom compensation" for 'transform' on <svg:text> SVGElement::calculateTransform would not compensate for effective zoom on 'transform' for SVG <text> elements. Refactor the code a bit so that the different parameter configurations are selected first, and then use the same code for both <text> and non- <text>. This makes sure that effective zoom is factored into the computed transform for <text> as well. BUG= 665387 ,369942 Review-Url: https://codereview.chromium.org/2565403002 Cr-Commit-Position: refs/heads/master@{#437927} [add] https://crrev.com/12ed8948ab2de41a58831f3093f8c5ca6f997493/third_party/WebKit/LayoutTests/svg/transforms/text-with-transform-and-zoom-expected.html [add] https://crrev.com/12ed8948ab2de41a58831f3093f8c5ca6f997493/third_party/WebKit/LayoutTests/svg/transforms/text-with-transform-and-zoom.html [modify] https://crrev.com/12ed8948ab2de41a58831f3093f8c5ca6f997493/third_party/WebKit/Source/core/svg/SVGElement.cpp
,
Dec 13 2016
,
Dec 13 2016
I can confirm that I've tested the latest build against our TC and this is now working correctly. Thanks for the amazingly fast turn around! |
||
►
Sign in to add a comment |
||
Comment 1 by f...@opera.com
, Nov 15 2016Labels: -OS-Linux -Pri-2 Pri-3
Status: Available (was: Unconfirmed)