Index: Source/core/page/scrolling/ScrollingCoordinator.cpp |
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
index 44e1df16a7fe1d7cd0d587a3403a4ccef6081f5b..3afc5ea442da0dd41ac2c7db92ea6bbcd0207077 100644 |
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp |
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
@@ -778,7 +778,7 @@ Region ScrollingCoordinator::computeShouldHandleScrollGestureOnMainThreadRegion( |
return shouldHandleScrollGestureOnMainThreadRegion; |
} |
-static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, const Document* document) |
+static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, Document* document) |
{ |
ASSERT(document); |
if (!document->touchEventTargets()) |
@@ -790,7 +790,12 @@ static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, co |
// then we can quickly mark the entire document and skip looking at any other handlers. |
// Note that technically a handler on the body doesn't cover the whole document, but it's |
// reasonable to be conservative and report the whole document anyway. |
- for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) { |
+ // |
+ // Fullscreen HTML5 video on Android is implemented by replacing the root cc:layer with the |
+ // video layer so doing this optimization causes the compositor to think that there are no |
+ // handlers when in full screen therefore skip it. |
+ bool inFullscreenOnAndroid = RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && RenderLayerCompositor::findFullscreenVideoRenderer(*document); |
abarth-chromium
2014/06/07 09:06:03
It's inefficient to call findFullscreenVideoRender
|
+ for (TouchEventTargetSet::const_iterator iter = targets->begin(); !inFullscreenOnAndroid && iter != targets->end(); ++iter) { |
Node* target = iter->key; |
if (target == document || target == document->documentElement() || target == document->body()) { |
if (RenderView* rendererView = document->renderView()) { |
@@ -801,12 +806,11 @@ static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, co |
} |
for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) { |
- const Node* target = iter->key; |
+ Node* target = iter->key; |
if (!target->inDocument()) |
continue; |
- if (target->isDocumentNode()) { |
- ASSERT(target != document); |
+ if (target->isDocumentNode() && target != document) { |
accumulateDocumentTouchEventTargetRects(rects, toDocument(target)); |
} else if (RenderObject* renderer = target->renderer()) { |
// If the set also contains one of our ancestor nodes then processing |