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

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

Issue 1413823005: Invalidate objects when containing block changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 21ccab9d8cb26f8079ceb849aa52325e45f68025..660dd4b6380ad5351c40e86a2db82f341c31a6e3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -887,7 +887,6 @@ LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject*
{
ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSkipped);
ASSERT(!isText());
- ASSERT(style()->position() == FixedPosition);
LayoutObject* ancestor = parent();
for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = ancestor->parent()) {
@@ -3391,7 +3390,7 @@ void LayoutObject::invalidateDisplayItemClientForNonCompositingDescendantsOf(con
traverseNonCompositingDescendants(const_cast<LayoutObject&>(object), Functor(paintInvalidationContainer));
}
-void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason reason) const
+void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason reason)
{
// These disablers are valid because we want to use the current compositing/invalidation status.
DisablePaintInvalidationStateAsserts invalidationDisabler;
@@ -3404,6 +3403,12 @@ void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo
// The PaintController may have changed. Pass the previous paint invalidation rect to the new PaintController.
// The rect will be updated if it changes during the next paint invalidation.
invalidateDisplayItemClients(paintInvalidationContainer, PaintInvalidationLayer, &invalidationRect);
+
+ // This method may be used to invalidate paint of an object changing paint invalidation container.
+ // Clear previous paint invalidation rect on the original paint invalidation container to avoid
+ // under-invalidation if the new paint invalidation rect on the new paint invalidation container
+ // happens to be the same as the old one.
+ setPreviousPaintInvalidationRect(LayoutRect());
}
void LayoutObject::invalidatePaintIncludingNonCompositingDescendants()

Powered by Google App Engine
This is Rietveld 408576698