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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 577353005: New InvalidationReasons: InvalidationBecameVisible and InvalidationBecameInvisible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Become -> Became Created 6 years, 3 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 | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 96a28d4392bcdb5cd41f7d77e5274e5d91ee2bc2..e1a532645b925f38639bfac65df091fb64780c91 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1258,6 +1258,10 @@ const char* RenderObject::invalidationReasonToString(InvalidationReason reason)
return "bounds change";
case InvalidationLocationChange:
return "location change";
+ case InvalidationBecameVisible:
+ return "became visible";
+ case InvalidationBecameInvisible:
+ return "became invisible";
case InvalidationScroll:
return "scroll";
case InvalidationSelection:
@@ -1366,13 +1370,6 @@ InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
if (newBounds.location() != oldBounds.location())
return InvalidationBoundsChange;
- // If the size is zero on one of our bounds then we know we're going to have
- // to do a full invalidation of either old bounds or new bounds. If we fall
- // into the incremental invalidation we'll issue two invalidations instead
- // of one.
- if (oldBounds.size().isZero() || newBounds.size().isZero())
- return InvalidationBoundsChange;
-
// This covers the case where we mark containing blocks for layout
// and they change size but don't have anything to paint. This is
// a pretty common case for <body> as we add / remove children
@@ -1380,6 +1377,15 @@ InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
if (skipInvalidationWhenLaidOutChildren())
return InvalidationNone;
+ // If the size is zero on one of our bounds then we know we're going to have
+ // to do a full invalidation of either old bounds or new bounds. If we fall
+ // into the incremental invalidation we'll issue two invalidations instead
+ // of one.
+ if (oldBounds.isEmpty())
+ return InvalidationBecameVisible;
+ if (newBounds.isEmpty())
+ return InvalidationBecameInvisible;
+
return InvalidationIncremental;
}
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698