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

Issue 2951353003: Get rid of *live granularity* behavior from selection (Closed)

Created:
3 years, 6 months ago by yosin_UTC9
Modified:
3 years, 5 months ago
Reviewers:
yoichio, Xiaocheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Get rid of *live granularity* behavior from selection This patch gets rid of *live granularity* unintentionally introduced by the patch[1] by making |ExpandSelectionToRespectUserSelectAll()| in |SelectionController| to return expanded selection for improving interoperability. The *live granularity* behavior is invoked by double-click or triple-click to select word/paragraph. Once *live granularity* behavior attached to selection, selection is automatically expanded in word/paragraph granularity. Example of live granularity: 1. On HTML fragment <span>xyz</span>, user does double click at "y". 2. Selection becomes <span>^xyz|</span>, where "^" is anchor and "|" is focus. 3. Inserting |Text| node "abc" before |Text| node "xyz" => "abcxyz" 4. Selection becomes <span>^abcxyz|</span> 5. Inserting |Text| node "def" after "xyz" => "abcxyzdef" 6. Selection becomes <span>^abcxyzdef|</span> If selection doesn't have live granularity behavior, it stays "abc^xyz|def". This is done by on-demand computation of |VisibleSelection| implemented in |SelectionEditor| which re-compute selection by using granularity in |SelectionInDOM| passed by |SelectionCotnroller| as result of user's double- click or triple-click. In other words, we propagate granularity property, which is set by double- click or triple-click from |SelectionCotnroller| to |SelectionEditor| and we keep it until explicit change of selection other than DOM mutation. This patch is a follow-up patch of [1]. Following patches will remove granularity member from |VisibleSelectionTemplate| and |SelectionTemplate|. [1] http://crrev.com/1648253002: Make VisibleSelection::updateIfNeeded() to consider text granularity BUG=692923 TEST=run_layout_tests editing/selection/double_click_and_modify.html Review-Url: https://codereview.chromium.org/2951353003 Cr-Commit-Position: refs/heads/master@{#482209} Committed: https://chromium.googlesource.com/chromium/src/+/385b35c99e76cccd7d7866a9545b6715951b53d1

Patch Set 1 : 2017-06-23T18:30:58 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -2 lines) Patch
A third_party/WebKit/LayoutTests/editing/selection/double_click_and_modify.html View 1 chunk +33 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionController.cpp View 1 chunk +11 lines, -2 lines 2 comments Download

Messages

Total messages: 36 (30 generated)
yosin_UTC9
PTAL
3 years, 6 months ago (2017-06-23 09:55:21 UTC) #20
Xiaocheng
The behavioral change is good. Only one comment. https://codereview.chromium.org/2951353003/diff/40001/third_party/WebKit/Source/core/editing/SelectionController.cpp File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/2951353003/diff/40001/third_party/WebKit/Source/core/editing/SelectionController.cpp#newcode90 third_party/WebKit/Source/core/editing/SelectionController.cpp:90: if ...
3 years, 6 months ago (2017-06-23 17:31:11 UTC) #28
yosin_UTC9
https://codereview.chromium.org/2951353003/diff/40001/third_party/WebKit/Source/core/editing/SelectionController.cpp File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/2951353003/diff/40001/third_party/WebKit/Source/core/editing/SelectionController.cpp#newcode90 third_party/WebKit/Source/core/editing/SelectionController.cpp:90: if (selection.IsBaseFirst()) On 2017/06/23 at 17:31:11, Xiaocheng wrote: > ...
3 years, 5 months ago (2017-06-26 04:14:50 UTC) #29
Xiaocheng
lgtm Thanks for the clarification.
3 years, 5 months ago (2017-06-26 05:10:38 UTC) #31
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/2951353003/40001
3 years, 5 months ago (2017-06-26 05:28:19 UTC) #33
commit-bot: I haz the power
3 years, 5 months ago (2017-06-26 07:25:35 UTC) #36
Message was sent while issue was closed.
Committed patchset #1 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/385b35c99e76cccd7d7866a9545b...

Powered by Google App Engine
This is Rietveld 408576698