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

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

Issue 1402133003: Skip updating nodeUnderMouse to clickTarget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test. Created 5 years, 2 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/mouseenter-mouseleave-on-drag-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/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index fd18e7773acb663f5283364ed8acf871ec2c1f9e..05d04fa5da29ccae25029bbd7e6dd4a5f2833f99 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -1270,8 +1270,16 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
// 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 (Node* clickTargetNode = mev.innerNode()->commonAncestor(*m_clickNode, parentForClickEvent))
- swallowClickEvent = !dispatchMouseEvent(EventTypeNames::click, clickTargetNode, m_clickCount, mouseEvent);
+ if (Node* clickTargetNode = mev.innerNode()->commonAncestor(
+ *m_clickNode, parentForClickEvent)) {
+
+ // Dispatch mouseup directly w/o calling updateMouseEventTargetNode
+ // because the mouseup dispatch above has already updated it
+ // correctly. Moreover, clickTargetNode is different from
+ // mev.innerNode at drag-release.
+ clickTargetNode->dispatchMouseEvent(mouseEvent,
+ EventTypeNames::click, m_clickCount);
+ }
}
if (m_resizeScrollableArea) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698