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

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

Issue 1882473002: Invalidate the bigger rect if one rect contains the other in LayoutObject::fullyInvalidateRect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/LayoutTests/TestExpectations ('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 7f99056f295989d367d4e20e5db8bc2c3d001678..101e9457a46145baca86bc6c8e4d2ba29bbf9f54 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1576,15 +1576,19 @@ void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
{
- // Otherwise do full paint invalidation.
- LayoutRect invalidationRect = oldBounds;
- adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
- invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason);
- if (newBounds != oldBounds) {
- invalidationRect = newBounds;
+ // The following logic avoids invalidating twice if one set of bounds contains the other.
+ if (!newBounds.contains(oldBounds)) {
+ LayoutRect invalidationRect = oldBounds;
adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason);
+
+ if (oldBounds.contains(newBounds))
+ return;
}
+
+ LayoutRect invalidationRect = newBounds;
+ adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
+ invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason);
}
void LayoutObject::invalidatePaintForOverflow()
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698