Index: Source/core/page/scrolling/ScrollingCoordinator.cpp |
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
index 6a9fb887b6105b3637e5a6f365c6cdef15d57b7e..92878e736dc5633a8d228cd3e73f4fc0a2a7739c 100644 |
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp |
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
@@ -828,10 +828,10 @@ Region ScrollingCoordinator::computeShouldHandleScrollGestureOnMainThreadRegion( |
return shouldHandleScrollGestureOnMainThreadRegion; |
} |
-static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, const Document* document) |
+static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, const Document* document, EventHandlerRegistry::EventHandlerClass touchHandlerClass) |
{ |
ASSERT(document); |
- const EventTargetSet* targets = document->frameHost()->eventHandlerRegistry().eventHandlerTargets(EventHandlerRegistry::TouchEvent); |
+ const EventTargetSet* targets = document->frameHost()->eventHandlerRegistry().eventHandlerTargets(touchHandlerClass); |
if (!targets) |
return; |
@@ -868,16 +868,16 @@ static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, co |
continue; |
if (node->isDocumentNode() && node != document) { |
- accumulateDocumentTouchEventTargetRects(rects, toDocument(node)); |
+ accumulateDocumentTouchEventTargetRects(rects, toDocument(node), touchHandlerClass); |
} else if (LayoutObject* layoutObject = node->layoutObject()) { |
- // If the set also contains one of our ancestor nodes then processing |
+ // If the set already contains this node or one of our ancestor nodes then processing |
// this node would be redundant. |
- bool hasTouchEventTargetAncestor = false; |
- for (Node* ancestor = node->parentNode(); ancestor && !hasTouchEventTargetAncestor; ancestor = ancestor->parentNode()) { |
+ bool rectsAlreadyIncluded = false; |
+ for (Node* ancestor = node; ancestor && !rectsAlreadyIncluded; ancestor = ancestor->parentNode()) { |
if (targets->contains(ancestor)) |
- hasTouchEventTargetAncestor = true; |
+ rectsAlreadyIncluded = true; |
} |
- if (!hasTouchEventTargetAncestor) { |
+ if (!rectsAlreadyIncluded) { |
// Walk up the tree to the outermost non-composited scrollable layer. |
DeprecatedPaintLayer* enclosingNonCompositedScrollLayer = nullptr; |
for (DeprecatedPaintLayer* parent = layoutObject->enclosingLayer(); parent && parent->compositingState() == NotComposited; parent = parent->parent()) { |
@@ -899,6 +899,12 @@ static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, co |
} |
} |
+static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, const Document* document) |
+{ |
+ accumulateDocumentTouchEventTargetRects(rects, document, EventHandlerRegistry::TouchEvent); |
+ accumulateDocumentTouchEventTargetRects(rects, document, EventHandlerRegistry::TouchMoveEvent); |
+} |
+ |
void ScrollingCoordinator::computeTouchEventTargetRects(LayerHitTestRects& rects) |
{ |
TRACE_EVENT0("input", "ScrollingCoordinator::computeTouchEventTargetRects"); |