| Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| index f4eeee797ae5a8b7ea851523977fe9e47e919e80..4f935a170985cdeb511e572fbf76317cbb8921bd 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| @@ -809,7 +809,7 @@ void PaintLayer::updateLayerPosition()
|
| }
|
|
|
| if (m_location != localPoint) {
|
| - setNeedsRepaint();
|
| + layoutObject()->setPaintingLayerNeedsRepaint();
|
| }
|
| m_location = localPoint;
|
|
|
| @@ -1197,7 +1197,7 @@ void PaintLayer::addChild(PaintLayer* child, PaintLayer* beforeChild)
|
| dirtyAncestorChainVisibleDescendantStatus();
|
| dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
|
|
|
| - child->setNeedsRepaint();
|
| + child->layoutObject()->setPaintingLayerNeedsRepaint();
|
|
|
| child->updateDescendantDependentFlags();
|
| }
|
| @@ -1246,7 +1246,7 @@ PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild)
|
| if (oldChild->enclosingPaginationLayer())
|
| oldChild->clearPaginationRecursive();
|
|
|
| - setNeedsRepaint();
|
| + layoutObject()->setPaintingLayerNeedsRepaint();
|
|
|
| return oldChild;
|
| }
|
| @@ -1324,8 +1324,6 @@ void PaintLayer::insertOnlyThisLayerAfterStyleChange()
|
| const LayoutBoxModelObject& previousPaintInvalidationContainer = layoutObject()->parent()->containerForPaintInvalidation();
|
| if (!previousPaintInvalidationContainer.styleRef().isStackingContext()) {
|
| layoutObject()->invalidatePaintIncludingNonSelfPaintingLayerDescendants(previousPaintInvalidationContainer);
|
| - // Set needsRepaint along the original compositingContainer chain.
|
| - layoutObject()->parent()->enclosingLayer()->setNeedsRepaint();
|
| didSetPaintInvalidation = true;
|
| }
|
| }
|
| @@ -2853,9 +2851,13 @@ void PaintLayer::computeSelfHitTestRects(LayerHitTestRects& rects) const
|
|
|
| void PaintLayer::setNeedsRepaint()
|
| {
|
| - m_needsRepaint = true;
|
| + DCHECK(layoutObject()->document().lifecycle().state() == DocumentLifecycle::InPaintInvalidation
|
| + || layoutObject()->document().lifecycle().state() == DocumentLifecycle::InPrePaint);
|
| +
|
| + if (m_needsRepaint)
|
| + return;
|
|
|
| - // Do this unconditionally to ensure container chain is marked when compositing status of the layer changes.
|
| + m_needsRepaint = true;
|
| markCompositingContainerChainForNeedsRepaint();
|
| }
|
|
|
|
|