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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 148423004: Only report bounding box touch hit rect for non-composited scroll layers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test description Created 6 years, 11 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/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index bf2f39420dadded07e16b9b51166dcd65e77b2a9..f121e577068c90f7a874406586d6604802e81e1b 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -3885,9 +3885,14 @@ void RenderLayer::addLayerHitTestRects(LayerHitTestRects& rects) const
if (renderBox() && renderBox()->scrollsOverflow()) {
// For scrolling layers, rects are taken to be in the space of the contents.
- // We need to include both the entire contents, and also the bounding box
- // of the layer in the space of it's parent (eg. for border / scroll bars).
- rect.append(m_scrollableArea->overflowRect());
+ // We need to include the bounding box of the layer in the space of its parent
+ // (eg. for border / scroll bars) and if it's composited then the entire contents
+ // as well as they may be on another composited layer. Skip reporting contents
+ // for non-composited layers as they'll get projected to the same layer as the
+ // bounding box.
+ if (compositingState() != NotComposited)
+ rect.append(m_scrollableArea->overflowRect());
+
rects.set(this, rect);
if (const RenderLayer* parentLayer = parent()) {
LayerHitTestRects::iterator iter = rects.find(parentLayer);

Powered by Google App Engine
This is Rietveld 408576698