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

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

Issue 1176423008: Forward mouse down node information to WebWidgetClient (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: call onMouseDown for GestureTap righter after MousePress is dispatched Created 5 years, 6 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 | Source/core/page/ChromeClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/input/EventHandler.cpp
diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp
index 19698b6bf5a0b587896378adc6a5058273c8515d..8bde8d0a3542ce6afa4dd31c70d0e7f5106c93ef 100644
--- a/Source/core/input/EventHandler.cpp
+++ b/Source/core/input/EventHandler.cpp
@@ -998,6 +998,13 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
swallowEvent = handleMousePressEvent(mev);
}
+ if (mev.hitTestResult().innerNode() && mouseEvent.button() == LeftButton) {
+ ASSERT(mouseEvent.type() == PlatformEvent::MousePressed);
+ HitTestResult result = mev.hitTestResult();
+ result.setToShadowHostIfInUserAgentShadowRoot();
+ m_frame->chromeClient().onMouseDown(result.innerNode());
+ }
+
return swallowEvent;
}
@@ -2034,6 +2041,13 @@ bool EventHandler::handleGestureTap(const GestureEventWithHitTestResults& target
if (!swallowMouseDownEvent)
swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResults(fakeMouseDown, currentHitTest));
+ if (currentHitTest.innerNode()) {
+ ASSERT(gestureEvent.type() == PlatformEvent::GestureTap);
+ HitTestResult result = currentHitTest;
+ result.setToShadowHostIfInUserAgentShadowRoot();
+ m_frame->chromeClient().onMouseDown(result.innerNode());
+ }
+
// FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug.com/398920
if (currentHitTest.innerNode()) {
LocalFrame* mainFrame = m_frame->localFrameRoot();
« no previous file with comments | « no previous file | Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698