New issue
Advanced search Search tips

Issue 673986 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Views::Textfield: Clicking inside multi character glyphs may not work correctly.

Project Member Reported by karandeepb@chromium.org, Dec 14 2016

Issue description

Chrome Version: 57.0.2935.0

What steps will reproduce the problem?
(1) Open Bookmark bubble.
(2) Paste the hindi text - किनारा into the Name textfield. 
(3) Move the cursor to the right end of the text.
(4) Here कि is a single glyph. Click inside the glyph but towards its right edge.

What is the expected result?
Cursor should position after कि.

What happens instead?
Cursor does not move.

The same is observed for the text 😀ab. Clicking inside the emoticon but towards its right edge would not reposition the cursor.

 
Reason for this is that RenderTextHarfBuzz::FindCursorPosition does not always return a valid grapheme boundary index. As a result, RenderTextHarfBuzz::MoveCursor fails.
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 4 2017

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

commit 4e4ca175171eb6c46603799904a624e6797773e4
Author: karandeepb <karandeepb@chromium.org>
Date: Wed Jan 04 02:12:24 2017

RenderTextHarfBuzz: Add support for multi line text selection.

This CL-
  - Adds support for multi-line text selection to RenderTextHarfBuzz. To do this
    RenderTextHarfBuzz::FindCursorPosition and
    RenderTextHarfBuzz::GetSubstringBounds are reimplemented.
  - RenderTextHarfBuzz::FindCursorPosition now returns valid grapheme boundaries
    hence fixing  issue 673986 .
  - RenderTextHarfBuzz::GetSubstringBounds did already support multiline but the
    implementation was flawed. It relied on the text space bounds intersection
    computed from LineSegment's x_range paramater and from TextRunHarfBuzz.
    However these were not in sync if some newline segments were popped or if
    some text was truncated.
  - Enables multi-line text selection for views::Labels.
  - Corrects the behavior for RTL when mouse is dragged above/below the text
    bounds on MacViews.
  - Adds lots of tests.

BUG= 650120 ,  630365 ,  600166 ,  673986 
TEST= Open views_examples_with_content_exe. Select Labels from the dropdown.
Enter a large string in the "Content" textfield. Enable the Multiline and Text
Selection checkboxes. Ensure text selection works correctly on the Label.

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

[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text.h
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_harfbuzz.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_harfbuzz.h
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_unittest.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label.h
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label_unittest.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/textfield/textfield_unittest.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/examples/label_example.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/examples/label_example.h
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/selection_controller.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style.cc
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style.h
[modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style_mac.mm

Status: Fixed (was: Assigned)

Sign in to add a comment