New issue
Advanced search Search tips

Issue 665387 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

SVG text CSS transform: translate erroneously takes zoom level into account

Reported by tim.dep...@zentrick.com, Nov 15 2016

Issue description

UserAgent: 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.
 

Comment 1 by f...@opera.com, Nov 15 2016

Components: -Blink Blink>SVG
Labels: -OS-Linux -Pri-2 Pri-3
Status: Available (was: Unconfirmed)

Comment 2 by aidank...@gmail.com, 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 .

example.svg
703 bytes Download
Screenshot example.png
13.8 KB View Download
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Comment 4 by f...@opera.com, Dec 13 2016

Owner: f...@opera.com
Status: Fixed (was: Available)

Comment 5 by aidank...@gmail.com, 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