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

Issue 2618583003: [InputEvent] Add 'beforeinput' logic in |will*()| and guarded by a flag (3/11) (Closed)

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

Description

[InputEvent] Add 'beforeinput' logic in |will*()| and guarded by a flag (3/11) This CL added 'beforeinput' logic in: 1. |CompositeEditCommand::willApplyEditing()| 2. |EditCommandComposition::willUnapply()| 3. |EditCommandComposition::willReapply()| They are disabled by default, and following CLs will move 'beforeinput' logic one by one. This CL doesn't have behavior change. Please see bug and the design doc below for the big picture: https://docs.google.com/a/chromium.org/document/d/1M9bQaLKdRpR1qJ9i7zZKN-hKwd4ZkgJs5GPde2ZsDy0/edit?usp=sharing BUG=678795

Patch Set 1 #

Total comments: 3

Patch Set 2 : Change target to |startingRootEditableElement()| #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -19 lines) Patch
M third_party/WebKit/Source/core/editing/EditingUtilities.h View 3 chunks +18 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 1 chunk +43 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 1 5 chunks +45 lines, -13 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 17 (13 generated)
chongz
PTAL, thanks!
3 years, 11 months ago (2017-01-05 23:40:28 UTC) #7
Xiaocheng
+yosin https://codereview.chromium.org/2618583003/diff/1/third_party/WebKit/Source/core/editing/EditingUtilities.cpp File third_party/WebKit/Source/core/editing/EditingUtilities.cpp (right): https://codereview.chromium.org/2618583003/diff/1/third_party/WebKit/Source/core/editing/EditingUtilities.cpp#newcode2200 third_party/WebKit/Source/core/editing/EditingUtilities.cpp:2200: !target->isConnected()) We currently don't check this. Why do ...
3 years, 11 months ago (2017-01-06 02:24:53 UTC) #9
chongz
xiaocheng@ Thanks for the review! I've changed event target to |ensureComposition()->startingRootEditableElement()|, PTAL again, thanks! https://codereview.chromium.org/2618583003/diff/1/third_party/WebKit/Source/core/editing/EditingUtilities.cpp ...
3 years, 11 months ago (2017-01-09 23:42:48 UTC) #14
Xiaocheng
3 years, 11 months ago (2017-01-10 03:05:12 UTC) #15
lgtm

https://codereview.chromium.org/2618583003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/editing/EditingUtilities.cpp (right):

https://codereview.chromium.org/2618583003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/editing/EditingUtilities.cpp:2200:
!target->isConnected())
On 2017/01/09 at 23:42:48, chongz wrote:
> On 2017/01/06 02:24:53, Xiaocheng wrote:
> > We currently don't check this.
> > 
> > Why do we need to cancel subsequent processing when the target node is
removed?
> 
> We currently check |isConnected()| in
|Editor::deleteSelectionAfterDraggingWithEvents()| and
|Editor::replaceSelectionAfterDraggingWithEvents()| but not other places, but I
think we should do the same check for all 'beforeinput' to keep consistence.
> 
> See discussion with yosin@:
> https://codereview.chromium.org/2288913002/#msg21

Seems reasonable... As the event target is the editing host, if it gets removed,
no more operation can be done.

Powered by Google App Engine
This is Rietveld 408576698