| Index: Source/core/rendering/RenderLayer.cpp
|
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
|
| index be92d92417e0a84c5a96345eb64f1c16ec420a37..e399a93bd5506b537d5f783e25f74e61d0253d63 100644
|
| --- a/Source/core/rendering/RenderLayer.cpp
|
| +++ b/Source/core/rendering/RenderLayer.cpp
|
| @@ -1082,26 +1082,6 @@ 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();
|
| @@ -1602,33 +1582,15 @@ RenderLayer* RenderLayer::scrollParent() const
|
| if (stackingNode()->isNormalFlowOnly())
|
| return 0;
|
|
|
| - // A layer scrolls with its containing block. So to find the overflow scrolling layer
|
| - // that we scroll with respect to, we must ascend the layer tree until we reach the
|
| - // first overflow scrolling div at or above our containing block. I will refer to this
|
| - // layer as our 'scrolling ancestor'.
|
| - //
|
| - // Now, if we reside in a normal flow list, then we will naturally scroll with our scrolling
|
| - // ancestor, and we need not be composited. If, on the other hand, we reside in a z-order
|
| - // list, and on our walk upwards to our scrolling ancestor we find no layer that is a stacking
|
| - // context, then we know that in the stacking tree, we will not be in the subtree rooted at
|
| - // our scrolling ancestor, and we will therefore not scroll with it. In this case, we must
|
| - // 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();
|
| - if (!scrollParent || scrollParent->stackingNode()->isStackingContext())
|
| + if (!parent())
|
| return 0;
|
|
|
| - // If we hit a stacking context on our way up to the ancestor scrolling layer, it will already
|
| - // be composited due to an overflow scrolling parent, so we don't need to.
|
| - for (RenderLayer* ancestor = parent(); ancestor && ancestor != scrollParent; ancestor = ancestor->parent()) {
|
| - if (ancestor->stackingNode()->isStackingContext()) {
|
| - scrollParent = 0;
|
| - break;
|
| - }
|
| + for (RenderLayer* current = renderer()->containingBlock()->enclosingLayer(); !current->stackingNode()->isStackingContext(); current = current->renderer()->containingBlock()->enclosingLayer()) {
|
| + if (current->scrollsOverflow())
|
| + return current;
|
| }
|
|
|
| - return scrollParent;
|
| + return 0;
|
| }
|
|
|
| RenderLayer* RenderLayer::clipParent() const
|
|
|