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

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 1117753003: Fix under-invalidation about view background change caused by body style change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test expectations Created 5 years, 8 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
« no previous file with comments | « LayoutTests/virtual/slimmingpaint/fast/repaint/view-background-from-body-2-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 73f7f8464b0bf089ed79b73fa215138540ef74ba..ff44d9518b245f6da1df575f356eae31c304310e 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -3193,6 +3193,7 @@ void LayoutObject::setShouldInvalidateSelection()
m_bitfields.setShouldInvalidateSelection(true);
markContainerChainForPaintInvalidation();
}
+
void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reason)
{
// Only full invalidation reasons are allowed.
@@ -3202,6 +3203,15 @@ void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas
if (reason == PaintInvalidationFull)
reason = documentLifecycleBasedPaintInvalidationReason(document().lifecycle());
m_bitfields.setFullPaintInvalidationReason(reason);
+
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled() && isBody()) {
+ // The rootObject paints view's background. We need to invalidate it when
+ // view's background changes because of change of body's style.
+ // FIXME: The condition is broader than needed for simplicity.
+ // Might remove this when fixing crbug.com/475115.
+ if (LayoutObject* rootObject = document().documentElement()->layoutObject())
+ rootObject->setShouldDoFullPaintInvalidation();
+ }
}
ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation);
« no previous file with comments | « LayoutTests/virtual/slimmingpaint/fast/repaint/view-background-from-body-2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698