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; |
} |