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

Unified Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2807123002: Fix the wrong non-element node handling in EventHanlder and MouseEventManager (Closed)
Patch Set: try Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index ea204d0016d5ff04befd546cf3e5d6fee1e68c65..2bcfcdc8f6cda002675d3fbeb66e368beedc4c9a 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -258,13 +258,16 @@ WebInputEventResult MouseEventManager::DispatchMouseClickIfNeeded(
IsLinkSelection(mev));
if (should_dispatch_click_event) {
Node* click_target_node = nullptr;
- // Updates distribution because a 'mouseup' event listener can make the
- // tree dirty at dispatchMouseEvent() invocation above.
- // Unless distribution is updated, commonAncestor would hit ASSERT.
- if (click_node_ == mev.InnerNode()) {
+ // A click event should be fired even when a text node has been removed in
+ // mouseup event.
+ if ((mev.InnerNode()->IsTextNode() && click_node_->isConnected() &&
tkent 2017/04/11 04:16:14 I think this code has the following unexpected beh
tkent 2017/04/11 04:24:15 Maybe a logic would be: Node* mouseup_node = mev.
+ !mev.InnerNode()->isConnected()) ||
kochi 2017/04/11 04:25:00 (I am not sure and just checking) - Isn't click_no
+ click_node_ == mev.InnerNode()) {
kochi 2017/04/11 04:25:00 I'd guess "click_node_ == mev.InnerNode()" is the
click_target_node = click_node_;
- click_target_node->UpdateDistribution();
} else if (click_node_->GetDocument() == mev.InnerNode()->GetDocument()) {
+ // Updates distribution because a 'mouseup' event listener can make the
+ // tree dirty at dispatchMouseEvent() invocation above.
+ // Unless distribution is updated, commonAncestor would hit ASSERT.
click_node_->UpdateDistribution();
mev.InnerNode()->UpdateDistribution();
click_target_node = mev.InnerNode()->CommonAncestor(
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698