| Index: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
|
| index 86d5be22199f4895838dfab82c3ffd4eef60d642..23d8fa55e08bfee7b607b5a15f7ec5d227b004bb 100644
|
| --- a/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp
|
| @@ -20,6 +20,7 @@ PaintInvalidationState::PaintInvalidationState(const LayoutView& layoutView, Vec
|
| , m_viewClippingAndScrollOffsetDisabled(false)
|
| , m_paintInvalidationContainer(layoutView.containerForPaintInvalidation())
|
| , m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations)
|
| + , m_enclosingLayer(*layoutView.layer())
|
| {
|
| bool establishesPaintInvalidationContainer = layoutView == m_paintInvalidationContainer;
|
| if (!establishesPaintInvalidationContainer) {
|
| @@ -46,6 +47,7 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, Lay
|
| , m_viewClippingAndScrollOffsetDisabled(false)
|
| , m_paintInvalidationContainer(paintInvalidationContainer)
|
| , m_pendingDelayedPaintInvalidations(next.pendingDelayedPaintInvalidationTargets())
|
| + , m_enclosingLayer(next.enclosingLayer(layoutObject))
|
| {
|
| // FIXME: SVG could probably benefit from a stack-based optimization like html does. crbug.com/391054
|
| bool establishesPaintInvalidationContainer = layoutObject == m_paintInvalidationContainer;
|
| @@ -107,6 +109,7 @@ PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, con
|
| , m_paintOffset(next.m_paintOffset)
|
| , m_paintInvalidationContainer(next.m_paintInvalidationContainer)
|
| , m_pendingDelayedPaintInvalidations(next.pendingDelayedPaintInvalidationTargets())
|
| + , m_enclosingLayer(next.enclosingLayer(layoutObject))
|
| {
|
| ASSERT(layoutObject != m_paintInvalidationContainer);
|
|
|
| @@ -142,4 +145,19 @@ void PaintInvalidationState::applyClipIfNeeded(const LayoutObject& layoutObject)
|
| m_paintOffset -= box.scrolledContentOffset();
|
| }
|
|
|
| +PaintLayer& PaintInvalidationState::enclosingLayer(const LayoutObject& layoutObject) const
|
| +{
|
| + if (layoutObject.hasLayer())
|
| + return *toLayoutBoxModelObject(layoutObject).layer();
|
| +
|
| + // During paint invalidation, a multi-column spanner place holder invokes paint invalidation of
|
| + // its layoutObjectInFlowThread (which has a non-null spannerPlaceHolder) directly, skipping the
|
| + // parent of its layoutObjectInFlowThread which has a PaintLayer.
|
| + if (layoutObject.spannerPlaceholder())
|
| + return *layoutObject.enclosingLayer();
|
| +
|
| + ASSERT(layoutObject.enclosingLayer() == &m_enclosingLayer);
|
| + return m_enclosingLayer;
|
| +}
|
| +
|
| } // namespace blink
|
|
|