Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index 674186b357cc25273a1c4e223c1de0ad0ca2c62d..8f693d43b7abd71d75f69a09fe154af43389b0e5 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -3338,6 +3338,21 @@ LayoutRect RenderLayer::physicalBoundingBoxIncludingReflectionAndStackingChildre |
| return result; |
| } |
| +void expandCompositingRectForStackingChildren(const RenderLayer* ancestorLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) |
|
ojan
2014/06/03 23:59:38
Did you mean this to be static?
chrishtr
2014/06/04 00:01:39
Static but not a member function.
|
| +{ |
| + RenderLayerStackingNodeIterator iterator(*ancestorLayer->stackingNode(), AllChildren); |
| + while (RenderLayerStackingNode* node = iterator.next()) { |
| + // Here we exclude both directly composited layers and squashing layers |
| + // because those RenderLayers don't paint into the graphics layer |
| + // for this RenderLayer. For example, the bounds of squashed RenderLayers |
| + // will be included in the computation of the appropriate squashing |
| + // GraphicsLayer. |
| + if (options != RenderLayer::ApplyBoundsChickenEggHacks && node->layer()->compositingState() != NotComposited) |
| + continue; |
| + result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer, options)); |
| + } |
| +} |
| + |
| LayoutRect RenderLayer::boundingBoxForCompositing(const RenderLayer* ancestorLayer, CalculateBoundsOptions options) const |
| { |
| if (!isSelfPaintingLayer()) |
| @@ -3381,17 +3396,15 @@ LayoutRect RenderLayer::boundingBoxForCompositing(const RenderLayer* ancestorLay |
| LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(this)->stackingNode()); |
| #endif |
| - RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), AllChildren); |
| - while (RenderLayerStackingNode* node = iterator.next()) { |
| - // Here we exclude both directly composited layers and squashing layers |
| - // because those RenderLayers don't paint into the graphics layer |
| - // for this RenderLayer. For example, the bounds of squashed RenderLayers |
| - // will be included in the computation of the appropriate squashing |
| - // GraphicsLayer. |
| - if (options != ApplyBoundsChickenEggHacks && node->layer()->compositingState() != NotComposited) |
| - continue; |
| - result.unite(node->layer()->boundingBoxForCompositing(this, options)); |
| - } |
| + // Reflections are implemented with RenderLayers that hang off of the reflected layer. However, |
| + // the reflection layer subtree does not include the subtree of the parent RenderLayer, so |
| + // a recursive computation of stacking children yields no results. This breaks cases when there are stacking |
| + // children of the parent, that need to be included in reflected composited bounds. |
| + // Fix this by including composited bounds of stacking children of the reflected RenderLayer. |
| + if (parent() && parent()->reflectionInfo() && parent()->reflectionInfo()->reflectionLayer() == this) |
| + expandCompositingRectForStackingChildren(parent(), options, result); |
| + else |
| + expandCompositingRectForStackingChildren(this, options, result); |
| // FIXME: We can optimize the size of the composited layers, by not enlarging |
| // filtered areas with the outsets if we know that the filter is going to render in hardware. |