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

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

Issue 1907633002: Update distribution on the nodes involved in click (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | 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/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 2d6734fe3e55de31552918063107734b5633b74f..4d09e2db4f1f991626057e2b4a386f0e34fae25b 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1463,12 +1463,14 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
&& mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canParticipateInFlatTree()
&& !(selectionController().hasExtendedSelection() && isLinkSelection(mev));
if (shouldDispatchClickEvent) {
- // Updates distribution because a 'mouseup' event listener can make the
- // tree dirty at dispatchMouseEvent() invocation above.
- // Unless distribution is updated, commonAncestor would hit ASSERT.
- // Both m_clickNode and mev.innerNode() don't need to be updated
- // because commonAncestor() will exit early if their documents are different.
- m_clickNode->updateDistribution();
+ if (m_clickNode != mev.innerNode()
dtapuska 2016/04/21 16:08:27 This isn't the same code as before.. What happens
+ && m_clickNode->document() == mev.innerNode()->document()) {
+ // Updates distribution because a 'mouseup' event listener can make the
+ // tree dirty at dispatchMouseEvent() invocation above.
+ // Unless distribution is updated, commonAncestor would hit ASSERT.
+ m_clickNode->updateDistribution();
+ mev.innerNode()->updateDistribution();
+ }
if (Node* clickTargetNode = mev.innerNode()->commonAncestor(
*m_clickNode, parentForClickEvent)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698