Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Issue 2541313002: RenderTextHarfBuzz: Add support for multi line text selection. (Closed)

Created:
4 years ago by karandeepb
Modified:
3 years, 11 months ago
Reviewers:
msw
CC:
chromium-reviews, tfarina, derat+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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. Committed: https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4 Cr-Commit-Position: refs/heads/master@{#441290}

Patch Set 1 : -- #

Total comments: 20

Patch Set 2 : -- #

Total comments: 1

Patch Set 3 : --- #

Total comments: 46

Patch Set 4 : Address review. #

Patch Set 5 : Tests #

Total comments: 16

Patch Set 6 : GetSubstringBounds now handles mid glyph selections correctly. #

Patch Set 7 : Nits. #

Patch Set 8 : FindCursorPosition now returns valid grapheme boundaries. crbug.com/673986 #

Total comments: 3

Patch Set 9 : Compile error. #

Patch Set 10 : Nits. #

Total comments: 11

Patch Set 11 : Address comments. #

Total comments: 2

Patch Set 12 : Nit. #

Patch Set 13 : Rebase. #

Patch Set 14 : Fix test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+608 lines, -231 lines) Patch
M ui/gfx/render_text.h View 1 2 3 4 5 6 6 chunks +23 lines, -14 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 8 chunks +46 lines, -42 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +20 lines, -4 lines 0 comments Download
M ui/gfx/render_text_harfbuzz.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +155 lines, -79 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 14 chunks +204 lines, -15 lines 0 comments Download
M ui/views/controls/label.h View 1 2 3 2 chunks +7 lines, -7 lines 0 comments Download
M ui/views/controls/label.cc View 2 chunks +1 line, -3 lines 0 comments Download
M ui/views/controls/label_unittest.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +101 lines, -23 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 18 chunks +35 lines, -25 lines 0 comments Download
M ui/views/examples/label_example.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/examples/label_example.cc View 1 2 3 4 5 5 chunks +14 lines, -1 line 0 comments Download
M ui/views/selection_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -12 lines 0 comments Download
M ui/views/style/platform_style.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/style/platform_style.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/style/platform_style_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 75 (60 generated)
karandeepb
PTAL msw@. Can you do an initial review before I add tests? Also, if possible, ...
4 years ago (2016-12-07 03:57:48 UTC) #20
msw
This looks pretty good; I'll try to test it manually soon. You can also ping ...
4 years ago (2016-12-07 20:20:35 UTC) #24
karandeepb
PTAL msw@. Have added some tests as well. Also, I think you missed my comments/questions ...
4 years ago (2016-12-12 10:36:19 UTC) #29
msw
Sorry I missed your earlier comments/questions, and sorry that I have forgotten some details about ...
4 years ago (2016-12-13 03:04:56 UTC) #30
karandeepb
PTAL msw@. I have corrected some behavior: - Particularly, behavior of GetSubstringBounds when the queries ...
4 years ago (2016-12-16 02:58:39 UTC) #44
msw
Mostly lg, thanks for digging in to the details here! https://codereview.chromium.org/2541313002/diff/120001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/2541313002/diff/120001/ui/gfx/render_text_harfbuzz.cc#newcode851 ...
4 years ago (2016-12-19 22:27:43 UTC) #46
karandeepb
PTAL msw@. https://codereview.chromium.org/2541313002/diff/440001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/2541313002/diff/440001/ui/gfx/render_text_harfbuzz.cc#newcode889 ui/gfx/render_text_harfbuzz.cc:889: : SelectionModel(index, CURSOR_FORWARD); On 2016/12/19 22:27:43, msw ...
4 years ago (2016-12-21 14:23:44 UTC) #51
msw
lgtm https://codereview.chromium.org/2541313002/diff/480001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/2541313002/diff/480001/ui/gfx/render_text_harfbuzz.cc#newcode714 ui/gfx/render_text_harfbuzz.cc:714: size_t left_index = is_rtl ? char_range.end() - 1 ...
4 years ago (2016-12-21 20:29:11 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2541313002/500001
4 years ago (2016-12-22 10:21:14 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/331511)
4 years ago (2016-12-22 10:27:06 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2541313002/560001
4 years ago (2016-12-22 10:50:39 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/359368)
4 years ago (2016-12-22 12:11:41 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2541313002/580001
3 years, 11 months ago (2017-01-04 02:07:42 UTC) #70
commit-bot: I haz the power
Committed patchset #14 (id:580001)
3 years, 11 months ago (2017-01-04 02:13:02 UTC) #73
commit-bot: I haz the power
3 years, 11 months ago (2017-01-04 02:15:14 UTC) #75
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4
Cr-Commit-Position: refs/heads/master@{#441290}

Powered by Google App Engine
This is Rietveld 408576698