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

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 | « no previous file | 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 0c6f807ad672cb735dc2bb633c22be393993eedb..fe5d7bcd8d996a955627057b95c6b58c5df8c755 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1581,11 +1581,16 @@ void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
pdr. 2016/04/12 03:01:22 This logic took me a while to reason through. It's
Xianzhu 2016/04/12 16:47:50 Done (except that oldBounds and newBounds inversed
{
- // Otherwise do full paint invalidation.
LayoutRect invalidationRect = oldBounds;
+ bool oneRectContainsTheOther = true;
+ if (newBounds.contains(oldBounds))
+ invalidationRect = newBounds;
+ else if (!oldBounds.contains(newBounds))
+ oneRectContainsTheOther = false;
+
adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason);
- if (newBounds != oldBounds) {
+ if (!oneRectContainsTheOther) {
invalidationRect = newBounds;
adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalidationContainer);
invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698