New issue
Advanced search Search tips

Issue 793075 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Selection offset from cursor for <text> with transform and textLength

Reported by philipp....@gmail.com, Dec 7 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.52 Safari/537.36

Steps to reproduce the problem:
1. Go to https://bug1423973.bmoattachments.org/attachment.cgi?id=8935482, https://bug1423973.bmoattachments.org/attachment.cgi?id=8935488 or open the attached test case.

2. Do not mind the alert and click it away. It does not concern you (actually it might but this is for another bug report, it has to do with browser differences for getComputedTextLength() in conjunction with textLength).

3. Try to select the text from the middle or from the right end.

What is the expected behavior?
Selection should happen where the text cursor is.

What went wrong?
The more right you start your selection from, the more there seems to be an offset between the visible cursor position and where the selection is happening.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 63.0.3239.52  Channel: n/a
OS Version: 
Flash Version: 

Reproduced on Linux and Windows.

Works fine in Mozilla Firefox. In IE/Edge there is also no offset but instead there are graphical glitches.
 
getComputedTextLength vs. textLength.html
1.1 KB View Download
Components: Blink>SVG
Labels: OS-Android OS-Chrome OS-Mac OS-Windows
Status: Available (was: Unconfirmed)

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

So we have tests for pretty much exactly this... and they are pretty much all have incorrect baselines checked in. Go figure.
Makes me wonder whether we rebaselined but still have an open bug for the tests producing incorrect results. You would need to search this bug database for mentions of the text names.

Comment 5 by f...@opera.com, Dec 13 2017

I think they were just part of a large rebaseline and not noticed (checked the commit log for one of the files and it was part of some baseline update related to "complex text", which seems relevant.) Nothing found in the bug database.
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 13 2017

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

commit 7517ac4a99d96ba7fc06862f8f84b00d427d0827
Author: Fredrik Söderquist <fs@opera.com>
Date: Wed Dec 13 16:44:57 2017

[PE] Fix text selection of <svg:text> subject to 'textLength'

With 'textLength' and 'lengthAdjust' with the value 'spacingAndGlyphs',
each SVGTextFragment is subject to an additional scale factor that
stretches the glyphs along the x- or y-axis.
This scale factor was not (any longer) taken into account by
SVGInlineTextBox::OffsetForPositionInFragment, which resulted in the
incorrect offset being calculcated.
Apply the (inverse) length_adjust_scale from SVGTextFragment before
querying the font for an offset.

Remove the |include_partial_glyphs| argument from
SVGInlineTextBox::OffsetForPositionInFragment since it's always true,
and also use 'float' rather LayoutUnit for the position.
Remove the dead |horizontal_glyph_stretch_| member variable from TextRun
since it's no longer used (since the simple shaper path was removed.)

Bug:  793075 
Change-Id: Ia7d369d914f5afd87d198b7b21077e180fc8bc59
Reviewed-on: https://chromium-review.googlesource.com/824162
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523787}
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/linux/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.png
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/LayoutTests/platform/win/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.txt
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/core/layout/svg/SVGTextFragment.h
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.h
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/platform/text/TextRun.cpp
[modify] https://crrev.com/7517ac4a99d96ba7fc06862f8f84b00d427d0827/third_party/WebKit/Source/platform/text/TextRun.h

Comment 7 by f...@opera.com, Dec 13 2017

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

Sign in to add a comment