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

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

Issue 1368163002: Workaround rect-based paint invalidation on ancestor clip change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 4181c785c95ba9080af6ac10e5077d4bfd866908..10985cfa7b88464be2d9f7b8f7b4a913e84e0d45 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -363,6 +363,8 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(PaintInvalidationState& paintI
// FIXME: This assert should be re-enabled when we move paint invalidation to after compositing update. crbug.com/360286
// ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
+ LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRect();
+
PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
clearPaintInvalidationState(paintInvalidationState);
@@ -373,10 +375,18 @@ void LayoutBoxModelObject::invalidateTreeIfNeeded(PaintInvalidationState& paintI
if (reason == PaintInvalidationLocationChange)
childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
- // Workaround for crbug.com/533277.
+ // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove when we enable paint offset caching.
if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef()))
childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
+ // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't have enough saved information to do accurate check
+ // of clipping change. Will remove when we remove rect-based paint invalidation.
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()
+ && previousPaintInvalidationRect != this->previousPaintInvalidationRect()
chrishtr 2015/09/28 17:38:13 If the rect changes, why didn't invalidatePaintIfN
Xianzhu 2015/09/28 17:49:05 These condition are for the ancestor whose clip ch
chrishtr 2015/09/28 22:16:29 Ok, but in what situation is invalidatePaintIfNeed
Xianzhu 2015/09/28 22:56:26 Let's take the added layout test as an example: <
chrishtr 2015/09/28 23:38:13 This all sounds great, and makes sense. What I don
Xianzhu 2015/09/28 23:51:48 I see your question now :) Simple style change (e
+ && !usesCompositedScrolling()
+ && hasOverflowClip())
+ childTreeWalkState.setForceSubtreeInvalidationRectUpdateWithinContainer();
+
invalidatePaintOfSubtreesIfNeeded(childTreeWalkState);
}

Powered by Google App Engine
This is Rietveld 408576698