New issue
Advanced search Search tips

Issue 719522 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

SVG textLength not working correctly

Reported by jason.da...@gmail.com, May 8 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36

Steps to reproduce the problem:
1. Open the attached bug.svg file, containing <text textLength="1200">test</text>
2. Notice how the right-hand edge of the text does not line up with the red rectangle
3. Compare with FireFox.

What is the expected behavior?
Right-hand edge of text should touch right-hand edge of red rectangle.

What went wrong?
The text does not fill the full width specified by textLength.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.96  Channel: stable
OS Version: OS X 10.12.4
Flash Version:
 
bug.svg
264 bytes Download
I have also verified that the bug exists in Canary/Mac [Version 60.0.3093.0 (Official Build) canary (64-bit)]
I have also reproduced the bug in Safari Version 10.1 (12603.1.30.0.34).

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

Labels: -OS-Mac
Status: Available (was: Unconfirmed)
I believe we have an off-by-one here...

Comment 4 Deleted

Comment 5 Deleted

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

WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=171805 (courtesy of reporter)
Labels: PaintTeamTriaged-20170508 BugSource-User OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
Project Member

Comment 8 by bugdroid1@chromium.org, May 11 2017

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

commit 308e792b8d4648ba4e298c80faca80bc780b5735
Author: fs <fs@opera.com>
Date: Thu May 11 12:13:01 2017

Fix textLength position adjustment for the "adjust spacing" case

There should be no advance adjustment after the last character (really,
"typographic unit"), so divide the excess space by the character count
minus one - i.e the number of gaps - rather than the character count.

BUG= 719522 

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

[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textLayout-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textLayout-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textLength-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textLength-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/dynamic-updates/SVGTextElement-dom-textLength-attr-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/dynamic-updates/SVGTextElement-svgdom-textLength-prop-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-squeeze-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacing-stretch-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-selection-text-01-b-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/batik/text/textLayout-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac-retina/svg/batik/text/textLayout-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textLayout-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textLayout-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textLength-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textLength-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGTextElement-dom-textLength-attr-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/dynamic-updates/SVGTextElement-svgdom-textLength-prop-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-squeeze-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.png
[add] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacing-stretch-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-selection-text-01-b-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/W3C-SVG-1.1/text-text-01-b-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textLayout-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textLayout-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textLength-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textLength-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/dynamic-updates/SVGTextElement-dom-textLength-attr-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/dynamic-updates/SVGTextElement-svgdom-textLength-prop-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-squeeze-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-1-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-2-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-3-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacing-stretch-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-01-b-expected.png
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/LayoutTests/platform/win/svg/text/text-selection-text-01-b-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-squeeze-1-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-squeeze-2-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-squeeze-3-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-squeeze-4-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-stretch-1-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-stretch-2-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-stretch-3-expected.txt
[delete] https://crrev.com/adbcf1feb08731127872db3b215e9c7742335647/third_party/WebKit/LayoutTests/svg/text/select-textLength-spacing-stretch-4-expected.txt
[modify] https://crrev.com/308e792b8d4648ba4e298c80faca80bc780b5735/third_party/WebKit/Source/core/layout/svg/SVGTextChunkBuilder.cpp

Project Member

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

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

commit 1cc74004b24c8a79dcee523e913c1d929c1167da
Author: fs <fs@opera.com>
Date: Fri May 12 08:16:02 2017

Fix textPath textLength position adjustment for the spacing case

Follow-up to https://codereview.chromium.org/2870393002, adjusting the
<textPath> 'textLength' computation in the same way.

BUG= 719522 

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

[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textOnPathSpaces-expected.png
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/linux/svg/batik/text/textOnPathSpaces-expected.txt
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textOnPathSpaces-expected.png
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/mac/svg/batik/text/textOnPathSpaces-expected.txt
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textOnPathSpaces-expected.png
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/LayoutTests/platform/win/svg/batik/text/textOnPathSpaces-expected.txt
[modify] https://crrev.com/1cc74004b24c8a79dcee523e913c1d929c1167da/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp

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

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

Sign in to add a comment