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

Issue 988023005: Implementing directional selection strategy in Blink. (Closed)

Created:
5 years, 9 months ago by mfomitchev
Modified:
5 years, 8 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Implementing directional selection strategy in Blink. This lays the groundwork for supporting several "strategies" for how selection changes in response to moveRangeSelectionExtent(), which is used by Chrome when touch selection handles are dragged. In addition to the default strategy, which is the old behavior, this also implements direction-based strategy which is basically "expand by word, shrink by character". The plan is to hook this up to a Chrome flag (see https://codereview.chromium.org/1006003003) so that we have an option of doing A/B testing with Finch to compare different strategies. BUG=451255 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194339

Patch Set 1 #

Total comments: 3

Patch Set 2 : Adding WebSettings support, addressing nits, general cleanup. #

Patch Set 3 : Expanded a couple of comments. #

Total comments: 6

Patch Set 4 : Addressing review feedback. #

Total comments: 19

Patch Set 5 : Addressing some of the review feedback. #

Patch Set 6 : Addressing feedback. #

Total comments: 32

Patch Set 7 : Addressing review feedback. #

Patch Set 8 : Missing file. #

Total comments: 21

Patch Set 9 : Addressing feedback. #

Patch Set 10 : Putting GranularityStrategy into separate files. #

Total comments: 18

Patch Set 11 : Addressing feedback. #

Total comments: 16

Patch Set 12 : Addressing nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+430 lines, -41 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/FrameSelection.h View 1 2 3 4 5 6 5 chunks +13 lines, -2 lines 0 comments Download
M Source/core/editing/FrameSelection.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +31 lines, -10 lines 0 comments Download
M Source/core/editing/FrameSelectionTest.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +127 lines, -13 lines 0 comments Download
A Source/core/editing/GranularityStrategy.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +72 lines, -0 lines 0 comments Download
A Source/core/editing/GranularityStrategy.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +128 lines, -0 lines 0 comments Download
A Source/core/editing/SelectionStrategy.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -0 lines 0 comments Download
M Source/core/editing/VisibleSelection.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/editing/VisibleSelection.cpp View 1 2 3 4 5 6 5 chunks +8 lines, -7 lines 0 comments Download
M Source/core/frame/Settings.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/Settings.in View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M Source/web/WebLocalFrameImpl.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -5 lines 0 comments Download
M Source/web/WebSettingsImpl.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebSettingsImpl.cpp View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M public/web/WebLocalFrame.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M public/web/WebSettings.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (9 generated)
yosin_UTC9
Concept of selection strategy is nice if we can it also covers things done in ...
5 years, 9 months ago (2015-03-10 01:37:03 UTC) #2
mfomitchev
Thanks for the quick response! My intention was to make GranularityStrategy an internal class in ...
5 years, 9 months ago (2015-03-10 02:57:02 UTC) #3
yosin_UTC9
On 2015/03/10 02:57:02, mfomitchev wrote: > Do you think I need to change anything in ...
5 years, 9 months ago (2015-03-10 05:48:28 UTC) #4
yoichio
I do not understand the purpose. If GranularityStrategy is used only in moveRangeSelectionExtent, you just ...
5 years, 9 months ago (2015-03-10 06:15:39 UTC) #5
mfomitchev
On 2015/03/10 06:15:39, yoichio wrote: > I do not understand the purpose. > > Anything ...
5 years, 9 months ago (2015-03-10 15:50:49 UTC) #6
yoichio
Your intention is modifying selection granularity considering selection history, right?
5 years, 9 months ago (2015-03-11 02:00:43 UTC) #7
jdduke (slow)
On 2015/03/11 02:00:43, yoichio wrote: > Your intention is modifying selection granularity considering selection history, ...
5 years, 9 months ago (2015-03-11 02:05:36 UTC) #8
mfomitchev
Correct. Roughly: expand by word, contract by character. The caveat is that once you contract ...
5 years, 9 months ago (2015-03-11 19:06:57 UTC) #9
yoichio
I got your idea and almost looks good:) Dragging selection is classified to 4 cases: ...
5 years, 9 months ago (2015-03-12 04:48:05 UTC) #10
mfomitchev
On 2015/03/12 04:48:05, yoichio wrote: > I got your idea and almost looks good:) > ...
5 years, 9 months ago (2015-03-12 21:27:38 UTC) #11
yoichio
> - To determine whether the selection is contracting, we need the cached > extentPosition ...
5 years, 9 months ago (2015-03-13 07:28:27 UTC) #12
mfomitchev
On 2015/03/13 07:28:27, yoichio wrote: > > - To determine whether the selection is contracting, ...
5 years, 9 months ago (2015-03-13 19:27:51 UTC) #13
mfomitchev
I cleaned up the patch and added WebSettings support. Please take another look.
5 years, 9 months ago (2015-03-14 00:04:13 UTC) #14
yoichio
> I see. So if I understand correctly, you are suggesting we leverage the > ...
5 years, 9 months ago (2015-03-16 04:49:16 UTC) #15
yoichio
https://codereview.chromium.org/988023005/diff/40001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/40001/Source/core/editing/FrameSelection.cpp#newcode100 Source/core/editing/FrameSelection.cpp:100: virtual VisiblePosition moveRangeSelectionExtent(const VisiblePosition&, FrameSelection*); Could you use |const ...
5 years, 9 months ago (2015-03-16 04:49:25 UTC) #16
mfomitchev
On 2015/03/16 04:49:16, yoichio wrote: > > I see. So if I understand correctly, you ...
5 years, 9 months ago (2015-03-16 17:14:12 UTC) #17
yoichio
> There's a FIXME next to setWithoutValidation saying that doing this is basically > a ...
5 years, 9 months ago (2015-03-17 05:54:41 UTC) #18
mfomitchev
On 2015/03/17 05:54:41, yoichio wrote: > > There's a FIXME next to setWithoutValidation saying that ...
5 years, 9 months ago (2015-03-17 17:01:16 UTC) #19
yosin_UTC9
https://codereview.chromium.org/988023005/diff/60001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/60001/Source/core/editing/FrameSelection.cpp#newcode100 Source/core/editing/FrameSelection.cpp:100: virtual VisiblePosition moveRangeSelectionExtent(const VisiblePosition&, const VisibleSelection&); Since, |moveRangeSelectionExtent()| returns ...
5 years, 9 months ago (2015-03-18 03:44:55 UTC) #20
yoichio
> On 2015/03/17 05:54:41, yoichio wrote: > > I wonder why this function looks procedural. ...
5 years, 9 months ago (2015-03-18 04:23:07 UTC) #21
yosin_UTC9
5 years, 9 months ago (2015-03-18 05:03:39 UTC) #22
mfomitchev
Thanks for the feedback! I addressed some of the comments. I will address the rest ...
5 years, 9 months ago (2015-03-19 01:24:39 UTC) #23
mfomitchev
@yosin - can you please comment on the questions in https://codereview.chromium.org/988023005/diff/60001/Source/core/editing/FrameSelection.cpp#newcode138 ?
5 years, 9 months ago (2015-03-21 20:10:18 UTC) #24
yosin_UTC9
https://codereview.chromium.org/988023005/diff/60001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/60001/Source/core/editing/FrameSelection.cpp#newcode138 Source/core/editing/FrameSelection.cpp:138: VisiblePosition m_wordBoundary; On 2015/03/19 01:24:39, mfomitchev wrote: > Ok. ...
5 years, 9 months ago (2015-03-23 07:20:40 UTC) #25
mfomitchev
Based on yosin's feedback I am now using setEndRespectingGranularity/setStartRespectingGranularity to avoid caching the extentPosition in ...
5 years, 8 months ago (2015-04-16 03:18:47 UTC) #26
mfomitchev
Also please note this relies on https://codereview.chromium.org/1089283002/, which I chose to submit as a separate ...
5 years, 8 months ago (2015-04-16 03:21:31 UTC) #27
mfomitchev
5 years, 8 months ago (2015-04-16 03:22:10 UTC) #29
yosin_UTC9
Could you try to avoid use term "default"? It is better to name current behavior ...
5 years, 8 months ago (2015-04-16 04:11:26 UTC) #30
Rick Byers
https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp#newcode2045 Source/core/editing/FrameSelection.cpp:2045: // right in the constructor - the correct settings ...
5 years, 8 months ago (2015-04-16 19:09:48 UTC) #31
mfomitchev1
https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp#newcode2045 Source/core/editing/FrameSelection.cpp:2045: // right in the constructor - the correct settings ...
5 years, 8 months ago (2015-04-16 19:33:00 UTC) #33
Rick Byers
https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp#newcode2045 Source/core/editing/FrameSelection.cpp:2045: // right in the constructor - the correct settings ...
5 years, 8 months ago (2015-04-16 19:35:11 UTC) #34
mfomitchev1
https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/100001/Source/core/editing/FrameSelection.cpp#newcode134 Source/core/editing/FrameSelection.cpp:134: VisiblePosition nextWordBound(const VisiblePosition& /*pos*/, int /*direction*/, bool /*nextIfOnBound*/); On ...
5 years, 8 months ago (2015-04-17 00:13:51 UTC) #35
mfomitchev
5 years, 8 months ago (2015-04-17 00:17:08 UTC) #37
yosin_UTC9
I recommend to use "git cl try" before asking review. https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp#newcode96 ...
5 years, 8 months ago (2015-04-17 04:24:51 UTC) #38
mfomitchev
https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp#newcode96 Source/core/editing/FrameSelection.cpp:96: class GranularityStrategy { On 2015/04/17 04:24:50, Yosi_UTC9 wrote: > ...
5 years, 8 months ago (2015-04-17 14:41:50 UTC) #39
yosin_UTC9
https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp#newcode96 Source/core/editing/FrameSelection.cpp:96: class GranularityStrategy { On 2015/04/17 14:41:49, mfomitchev wrote: > ...
5 years, 8 months ago (2015-04-20 01:25:55 UTC) #40
mfomitchev
On 2015/04/20 01:25:55, Yosi_UTC9 wrote: > https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp > File Source/core/editing/FrameSelection.cpp (right): > > https://codereview.chromium.org/988023005/diff/140001/Source/core/editing/FrameSelection.cpp#newcode96 > ...
5 years, 8 months ago (2015-04-20 20:14:57 UTC) #41
yosin_UTC9
Almost looks good. https://codereview.chromium.org/988023005/diff/180001/Source/core/editing/GranularityStrategy.cpp File Source/core/editing/GranularityStrategy.cpp (right): https://codereview.chromium.org/988023005/diff/180001/Source/core/editing/GranularityStrategy.cpp#newcode1 Source/core/editing/GranularityStrategy.cpp:1: /* nit: Let's use the short ...
5 years, 8 months ago (2015-04-21 01:59:52 UTC) #42
mfomitchev
https://codereview.chromium.org/988023005/diff/180001/Source/core/editing/GranularityStrategy.cpp File Source/core/editing/GranularityStrategy.cpp (right): https://codereview.chromium.org/988023005/diff/180001/Source/core/editing/GranularityStrategy.cpp#newcode1 Source/core/editing/GranularityStrategy.cpp:1: /* On 2015/04/21 01:59:51, Yosi_UTC9 wrote: > nit: Let's ...
5 years, 8 months ago (2015-04-21 18:44:25 UTC) #43
mfomitchev
yosin: Can you please LGTM if the CL looks good to you? Thanks!
5 years, 8 months ago (2015-04-22 15:41:42 UTC) #44
yosin_UTC9
lgtm w/ small nits. https://codereview.chromium.org/988023005/diff/200001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/200001/Source/core/editing/FrameSelection.cpp#newcode226 Source/core/editing/FrameSelection.cpp:226: if (m_granularityStrategy && (options & ...
5 years, 8 months ago (2015-04-23 03:38:47 UTC) #45
mfomitchev
https://codereview.chromium.org/988023005/diff/200001/Source/core/editing/FrameSelection.cpp File Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/988023005/diff/200001/Source/core/editing/FrameSelection.cpp#newcode226 Source/core/editing/FrameSelection.cpp:226: if (m_granularityStrategy && (options & FrameSelection::DoNotClearStrategy) == 0) { ...
5 years, 8 months ago (2015-04-23 15:08:11 UTC) #46
Rick Byers
Source/core/editing rubber stamp LGTM (yosin@ is the expert) remaining Source/core and Source/public LGTM
5 years, 8 months ago (2015-04-23 15:17:47 UTC) #47
mfomitchev
aelias@chromium.org: Please review changes in Source/web
5 years, 8 months ago (2015-04-23 15:18:55 UTC) #49
aelias_OOO_until_Jul13
Source/web lgtm
5 years, 8 months ago (2015-04-24 00:58:57 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988023005/220001
5 years, 8 months ago (2015-04-24 01:32:20 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/android_chromium_gn_compile_rel/builds/33832)
5 years, 8 months ago (2015-04-24 01:39:28 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988023005/220001
5 years, 8 months ago (2015-04-24 02:55:06 UTC) #57
commit-bot: I haz the power
5 years, 8 months ago (2015-04-24 02:59:14 UTC) #58
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=194339

Powered by Google App Engine
This is Rietveld 408576698