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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1055683003: (NOT FOR REVIEW) Distinguish between touch and touchmove handler presence (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix loading Created 5 years, 3 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/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");

Powered by Google App Engine
This is Rietveld 408576698