Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 1403963002: Invalidate non-self-painting-layer descendants when creating a layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove resetting of previousPaintInvalidationRect Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()) {
chrishtr 2015/10/14 18:22:32 Re testing: can you build on the test in https://c
Xianzhu 2015/10/14 19:47:21 Done.
+ if (!currentPaintInvalidationContainer->styleRef().isStackingContext())
+ invalidatePaintIncludingNonSelfPaintingLayerDescendants(*currentPaintInvalidationContainer);
+ }
}
ASSERT(!m_layer);

Powered by Google App Engine
This is Rietveld 408576698