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

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

Issue 344733003: Clean up ancestorScrollingLayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make sure we pass Adam's layout test. Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 1638a36ba7fa36eb7df2e3e7c2bf5407f546f158..3495b2a0171dd075488ce2357bf8d0fd0b154da7 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -1088,35 +1088,12 @@ RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot i
return 0;
}
-RenderLayer* RenderLayer::ancestorCompositedScrollingLayer() const
-{
- if (!compositor()->acceleratedCompositingForOverflowScrollEnabled())
- return 0;
-
- RenderObject* containingBlock = renderer()->containingBlock();
- if (!containingBlock)
- return 0;
-
- RenderLayer* ancestorCompositedScrollingLayer = 0;
- for (RenderLayer* ancestorLayer = containingBlock->enclosingLayer(); ancestorLayer; ancestorLayer = ancestorLayer->parent()) {
- if (ancestorLayer->needsCompositedScrolling()) {
- ancestorCompositedScrollingLayer = ancestorLayer;
- break;
- }
- }
-
- return ancestorCompositedScrollingLayer;
-}
-
RenderLayer* RenderLayer::ancestorScrollingLayer() const
{
- RenderObject* containingBlock = renderer()->containingBlock();
- if (!containingBlock)
- return 0;
-
- for (RenderLayer* ancestorLayer = containingBlock->enclosingLayer(); ancestorLayer; ancestorLayer = ancestorLayer->parent()) {
- if (ancestorLayer->scrollsOverflow())
- return ancestorLayer;
+ for (RenderObject* container = renderer()->containingBlock(); container; container = container->containingBlock()) {
+ RenderLayer* currentLayer = container->enclosingLayer();
+ if (currentLayer->scrollsOverflow())
+ return currentLayer;
}
return 0;
@@ -1621,7 +1598,7 @@ RenderLayer* RenderLayer::scrollParent() const
// be a composited layer since the compositor will need to take special measures to ensure
// that we scroll with our scrolling ancestor and it cannot do this if we do not promote.
- RenderLayer* scrollParent = ancestorCompositedScrollingLayer();
+ RenderLayer* scrollParent = ancestorScrollingLayer();
if (!scrollParent || scrollParent->stackingNode()->isStackingContext())
return 0;
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698