Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| index 1794f1c2bc07306de8fc59e3f16e6924de415167..dcf30ed39c937159c2dcbdb4bf999cbe9cc18526 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| @@ -280,20 +280,15 @@ void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt |
| void LayoutBoxModelObject::createLayer(PaintLayerType type) |
| { |
| - |
| - // Acquiring a PaintLayer may change the paint invalidation container. Therefore we must eagerly |
| - // invalidate paint for this object before creating the layer. |
| - if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && isRooted()) { |
| - DisablePaintInvalidationStateAsserts invalidationDisabler; |
| - DisableCompositingQueryAsserts compositingDisabler; |
| - |
| - // It would be more correct to call invalidatePaintIncludingNonCompositingDescendants, but |
| - // we do this instead to avoid performance issues when creating large numbers of layers. |
| - const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintInvalidationOnRootedTree(); |
| - invalidatePaintUsingContainer( |
| - paintInvalidationContainer, |
| - boundsRectForPaintInvalidation(&paintInvalidationContainer), |
| - PaintInvalidationLayer); |
| + // If the current paint invalidation container is not a stacking context and this object is |
| + // a or treated as a stacking context, creating this layer may cause this object and its |
| + // descendants to change paint invalidation container. Therefore we must eagerly invalidate |
| + // them on the original paint invalidation container before creating the layer. |
| + if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && isRooted() && styleRef().isTreatedAsOrStackingContext()) { |
| + if (const LayoutBoxModelObject* currentPaintInvalidationContainer = containerForPaintInvalidation()) { |
| + if (!currentPaintInvalidationContainer->styleRef().isStackingContext()) |
| + invalidatePaintIncludingNonSelfPaintingLayerDescendants(*currentPaintInvalidationContainer); |
|
Xianzhu
2015/10/13 23:58:12
Conditions are made stricter here to avoid duplica
|
| + } |
| } |
| ASSERT(!m_layer); |