| 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 5eed81877f073cfb7a536b2120991c542dc3b312..7b419ad9db642aef30b6c1ab0f5f27b70e2da17b 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| @@ -1252,11 +1252,12 @@ PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild)
|
| return oldChild;
|
| }
|
|
|
| -void PaintLayer::removeOnlyThisLayer()
|
| +void PaintLayer::removeOnlyThisLayerAfterStyleChange()
|
| {
|
| if (!m_parent)
|
| return;
|
|
|
| + bool didSetPaintInvalidation = false;
|
| if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| DisableCompositingQueryAsserts disabler; // We need the current compositing status.
|
| if (isPaintInvalidationContainer()) {
|
| @@ -1266,9 +1267,15 @@ void PaintLayer::removeOnlyThisLayer()
|
| DisablePaintInvalidationStateAsserts disabler;
|
| layoutObject()->invalidatePaintIncludingNonCompositingDescendants();
|
| layoutObject()->setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
|
| + didSetPaintInvalidation = true;
|
| }
|
| }
|
|
|
| + if (!didSetPaintInvalidation && isSelfPaintingLayer()) {
|
| + if (PaintLayer* enclosingSelfPaintingLayer = m_parent->enclosingSelfPaintingLayer())
|
| + enclosingSelfPaintingLayer->mergeNeedsPaintPhaseFlagsFrom(*this);
|
| + }
|
| +
|
| clipper().clearClipRectsIncludingDescendants();
|
|
|
| PaintLayer* nextSib = nextSibling();
|
| @@ -1295,7 +1302,7 @@ void PaintLayer::removeOnlyThisLayer()
|
| m_layoutObject->destroyLayer();
|
| }
|
|
|
| -void PaintLayer::insertOnlyThisLayer()
|
| +void PaintLayer::insertOnlyThisLayerAfterStyleChange()
|
| {
|
| if (!m_parent && layoutObject()->parent()) {
|
| // We need to connect ourselves when our layoutObject() has a parent.
|
| @@ -1310,6 +1317,23 @@ void PaintLayer::insertOnlyThisLayer()
|
| for (LayoutObject* curr = layoutObject()->slowFirstChild(); curr; curr = curr->nextSibling())
|
| curr->moveLayers(m_parent, this);
|
|
|
| + // If the previous paint invalidation container is not a stacking context and this object is
|
| + // stacked content, creating this layer may cause this object and its descendants to change
|
| + // paint invalidation container.
|
| + bool didSetPaintInvalidation = false;
|
| + if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && !layoutObject()->isLayoutView() && layoutObject()->isRooted() && layoutObject()->styleRef().isStacked()) {
|
| + const LayoutBoxModelObject& previousPaintInvalidationContainer = layoutObject()->parent()->containerForPaintInvalidation();
|
| + if (!previousPaintInvalidationContainer.styleRef().isStackingContext()) {
|
| + layoutObject()->invalidatePaintIncludingNonSelfPaintingLayerDescendants(previousPaintInvalidationContainer);
|
| + didSetPaintInvalidation = true;
|
| + }
|
| + }
|
| +
|
| + if (!didSetPaintInvalidation && isSelfPaintingLayer()) {
|
| + if (PaintLayer* enclosingSelfPaintingLayer = m_parent->enclosingSelfPaintingLayer())
|
| + mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer);
|
| + }
|
| +
|
| // Clear out all the clip rects.
|
| clipper().clearClipRectsIncludingDescendants();
|
| }
|
|
|