Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp |
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
index f03f62614a7c6c6d19eca779878a3618ab8fa14f..7a67e4caed9214ffd420db7074fde67742d0eb04 100644 |
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp |
@@ -878,7 +878,11 @@ |
} |
} |
- updateSquashingLayerGeometry(delta); |
+ { |
+ IntPoint squashingDelta(delta); |
+ squashingDelta.moveBy(-graphicsLayerParentLocation); |
+ updateSquashingLayerGeometry(squashingDelta); |
+ } |
if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scrollsOverflow()) |
m_owningLayer.scrollableArea()->positionOverflowControls(); |
@@ -970,16 +974,16 @@ |
// The squashing containment layer, if it exists, becomes a no-op parent. |
if (m_squashingLayer) { |
ASSERT(compositor()->layerSquashingEnabled()); |
- ASSERT(m_squashingContainmentLayer); |
- |
- m_squashingContainmentLayer->removeAllChildren(); |
- |
- if (m_ancestorClippingLayer) |
- m_squashingContainmentLayer->addChild(m_ancestorClippingLayer.get()); |
- else |
+ ASSERT((m_ancestorClippingLayer && !m_squashingContainmentLayer) || (!m_ancestorClippingLayer && m_squashingContainmentLayer)); |
+ |
+ if (m_squashingContainmentLayer) { |
+ m_squashingContainmentLayer->removeAllChildren(); |
m_squashingContainmentLayer->addChild(m_graphicsLayer.get()); |
- |
- m_squashingContainmentLayer->addChild(m_squashingLayer.get()); |
+ m_squashingContainmentLayer->addChild(m_squashingLayer.get()); |
+ } else { |
+ // The ancestor clipping layer is already set up and has m_graphicsLayer under it. |
+ m_ancestorClippingLayer->addChild(m_squashingLayer.get()); |
+ } |
} |
} |
@@ -1459,23 +1463,23 @@ |
m_squashingLayer->setDrawsContent(true); |
// FIXME: containment layer needs a new CompositingReason, CompositingReasonOverlap is not appropriate. |
- m_squashingContainmentLayer = createGraphicsLayer(CompositingReasonLayerForSquashingContainer); |
+ if (!m_ancestorClippingLayer) |
+ m_squashingContainmentLayer = createGraphicsLayer(CompositingReasonLayerForSquashingContainer); |
layersChanged = true; |
} |
- ASSERT(m_squashingLayer && m_squashingContainmentLayer); |
+ ASSERT(m_squashingLayer); |
} else { |
if (m_squashingLayer) { |
m_squashingLayer->removeFromParent(); |
m_squashingLayer = nullptr; |
- // FIXME: do we need to invalidate something here? |
- |
- ASSERT(m_squashingContainmentLayer); |
+ layersChanged = true; |
+ } |
+ if (m_squashingContainmentLayer) { |
m_squashingContainmentLayer->removeFromParent(); |
m_squashingContainmentLayer = nullptr; |
layersChanged = true; |
} |
- |
ASSERT(!m_squashingLayer && !m_squashingContainmentLayer); |
} |