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

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

Issue 1951043002: Don't let PaintInvalidationLocationChange shadow other reasons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85469ef8baeb70befcdbb797f57ebe3e3d300a91..cf65d3481606f8f83cf0fd38d607e5bac1e3a658 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1484,12 +1484,6 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox
const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking,
const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking) const
{
- // First check for InvalidationLocationChange to avoid it from being hidden by other
- // invalidation reasons because we'll need to force check for paint invalidation for
- // children when location of this object changed.
- if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking)
- return PaintInvalidationLocationChange;
-
if (shouldDoFullPaintInvalidation())
return m_bitfields.fullPaintInvalidationReason();
@@ -1499,11 +1493,12 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox
if (styleRef().hasOutline())
return PaintInvalidationOutline;
+ bool locationChanged = newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking;
+
// If the bounds are the same then we know that none of the statements below
- // can match, so we can early out since we will not need to do any
- // invalidation.
+ // can match, so we can early out.
if (oldBounds == newBounds)
- return PaintInvalidationNone;
+ return locationChanged && !oldBounds.isEmpty() ? PaintInvalidationLocationChange : PaintInvalidationNone;
// If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
// be caused by some layout property (left / top) or some in-flow layoutObject inserted / removed before us in the tree.
@@ -1526,6 +1521,9 @@ PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const LayoutBox
if (newBounds.isEmpty())
return PaintInvalidationBecameInvisible;
+ if (locationChanged)
+ return PaintInvalidationLocationChange;
+
return PaintInvalidationIncremental;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698