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

Issue 2708823003: Make SelecitonModifier class not to use VisibleSelection::setBase() and setExtent() (Closed)

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

Description

Make SelecitonModifier class not to use VisibleSelection::setBase() and setExtent() This patch makes |SelecitonModifier| class not to use |Position| version of |setBase()| and |setExtent()| of |VisibleSelection| as a preparation of making |VisibleSelection| immutable for improving code health. The concept of this patch is creating new |VisibleSelection| from |m_selection| and copying back to |m_selection| instead of modifying |m_selection| by using |setBase()| and |setExtent()|. This is done by decomposing |willModify()| into |isBaseFirst()|, returns true if |SelecitonModifier| uses selection start as base of new selection, and |prepareForExtend()| to return new |VisibleSelection| from start and end positions of passed |VisibleSelection|. Since |setBase()| and |setExtent()| call |VisibleSelection:::validate()|, the original code calls |validate()| twice, but this patch calls once. BUG=660320 TEST=n/a; no behavior changes Review-Url: https://codereview.chromium.org/2708823003 Cr-Commit-Position: refs/heads/master@{#451921} Committed: https://chromium.googlesource.com/chromium/src/+/453d5882079b36fa2ab5b2240b9bcad81428eaa8

Patch Set 1 : 2017-02-21T14:41:51 #

Patch Set 2 : 2017-02-21T16:54:44 #

Total comments: 8

Patch Set 3 : 2017-02-22T13:59:38 Follow review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -50 lines) Patch
M third_party/WebKit/Source/core/editing/SelectionModifier.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionModifier.cpp View 1 2 4 chunks +49 lines, -49 lines 0 comments Download

Messages

Total messages: 29 (20 generated)
yosin_UTC9
PTAL
3 years, 10 months ago (2017-02-21 09:15:32 UTC) #10
yosin_UTC9
+xiaochengh@, it seems he is working now. ;-)
3 years, 10 months ago (2017-02-21 23:24:56 UTC) #14
tkent
https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp File third_party/WebKit/Source/core/editing/SelectionModifier.cpp (right): https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp#newcode60 third_party/WebKit/Source/core/editing/SelectionModifier.cpp:60: static TextDirection directionOfEnclosingBlockOf(const Position& position) { What's the benefit ...
3 years, 10 months ago (2017-02-21 23:34:20 UTC) #16
Xiaocheng
https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp File third_party/WebKit/Source/core/editing/SelectionModifier.cpp (right): https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp#newcode85 third_party/WebKit/Source/core/editing/SelectionModifier.cpp:85: TextDirection SelectionModifier::directionOfSelection() const { On 2017/02/21 at 23:34:20, tkent ...
3 years, 10 months ago (2017-02-22 01:06:20 UTC) #18
tkent
https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp File third_party/WebKit/Source/core/editing/SelectionModifier.cpp (right): https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp#newcode85 third_party/WebKit/Source/core/editing/SelectionModifier.cpp:85: TextDirection SelectionModifier::directionOfSelection() const { On 2017/02/22 at 01:06:19, Xiaocheng ...
3 years, 10 months ago (2017-02-22 01:10:20 UTC) #19
yosin_UTC9
PTAL https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp File third_party/WebKit/Source/core/editing/SelectionModifier.cpp (right): https://codereview.chromium.org/2708823003/diff/20001/third_party/WebKit/Source/core/editing/SelectionModifier.cpp#newcode60 third_party/WebKit/Source/core/editing/SelectionModifier.cpp:60: static TextDirection directionOfEnclosingBlockOf(const Position& position) { On 2017/02/21 ...
3 years, 10 months ago (2017-02-22 05:11:05 UTC) #22
tkent
lgtm
3 years, 10 months ago (2017-02-22 05:20:26 UTC) #23
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/2708823003/40001
3 years, 10 months ago (2017-02-22 05:45:00 UTC) #26
commit-bot: I haz the power
3 years, 10 months ago (2017-02-22 08:11:56 UTC) #29
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/453d5882079b36fa2ab5b2240b9b...

Powered by Google App Engine
This is Rietveld 408576698