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

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

Issue 490783003: Reduce hit test on ShowPress by moving event targeting to WebViewImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unnecessary headers Created 6 years, 4 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
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 05663c09738673aaa0d6aae6bd7cb55572b475a8..0590ba05fc9452d395593cf165663745efa17dd6 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -69,7 +69,6 @@
#include "core/page/DragController.h"
#include "core/page/DragState.h"
#include "core/page/EditorClient.h"
-#include "core/page/EventWithHitTestResults.h"
#include "core/page/FocusController.h"
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
@@ -2070,17 +2069,26 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
// Scrolling-related gesture events invoke EventHandler recursively for each frame down
// the chain, doing a single-frame hit-test per frame. This matches handleWheelEvent.
- // Perhaps we could simplify things by rewriting scroll handling to work inner frame
- // out, and then unify with other gesture events.
if (gestureEvent.isScrollEvent())
- return handleGestureScrollEvent(gestureEvent);
-
- // Non-scrolling related gesture events instead do a single cross-frame hit-test and
- // jump directly to the inner most frame. This matches handleMousePressEvent etc.
+ handleGestureScrollEvent(gestureEvent);
Rick Byers 2014/08/22 14:49:57 you still need the return here, right?
Zeeshan Qureshi 2014/08/22 15:30:50 Oh yes, and all the tests passed!
// Hit test across all frames and do touch adjustment as necessary for the event type.
GestureEventWithHitTestResults targetedEvent = targetGestureEvent(gestureEvent);
+ return handleGestureEvent(targetedEvent);
+}
+
+bool EventHandler::handleGestureEvent(const GestureEventWithHitTestResults& targetedEvent)
+{
+ TRACE_EVENT0("input", "EventHandler::handleGestureEvent");
+
+ // Propagation to inner frames is handled below this function.
+ ASSERT(m_frame == m_frame->localFrameRoot());
+
+ // Non-scrolling related gesture events do a single cross-frame hit-test and jump
+ // directly to the inner most frame. This matches handleMousePressEvent etc.
+ ASSERT(!targetedEvent.event().isScrollEvent());
+
// Route to the correct frame.
if (LocalFrame* innerFrame = targetedEvent.hitTestResult().innerNodeFrame())
return innerFrame->eventHandler().handleGestureEventInFrame(targetedEvent);
@@ -2140,6 +2148,8 @@ bool EventHandler::handleGestureEventInFrame(const GestureEventWithHitTestResult
bool EventHandler::handleGestureScrollEvent(const PlatformGestureEvent& gestureEvent)
{
+ TRACE_EVENT0("input", "EventHandler::handleGestureScrollEvent");
+
RefPtrWillBeRawPtr<Node> eventTarget = nullptr;
RefPtr<Scrollbar> scrollbar;
if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) {

Powered by Google App Engine
This is Rietveld 408576698