Index: Source/core/rendering/RenderObject.h |
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h |
index 61fa7447447d2a151475cfc24fe6d5f205b5779b..2781e14543993cab0893825f9d6c4db57c0880f2 100644 |
--- a/Source/core/rendering/RenderObject.h |
+++ b/Source/core/rendering/RenderObject.h |
@@ -849,6 +849,11 @@ public: |
// Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint invalidation state. |
virtual void invalidateTreeIfNeeded(const PaintInvalidationState&); |
+ // For now RenderBoxes and RenderSVGModelObjects know how to invalidate themselves in invalidateTreeIfNeeded. |
+ // Other objects (e.g. RenderText, RenderInline, etc) depend on their containers for invalidation. |
+ // crbug.com/394133. |
+ bool canSelfInvalidateDuringTreeInvalidation() const { return isBox() || isSVG(); } |
+ |
virtual void invalidatePaintForOverflow(); |
void invalidatePaintForOverflowIfNeeded(); |
@@ -998,7 +1003,8 @@ public: |
void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& location) { m_previousPositionFromPaintInvalidationContainer = location; } |
bool shouldDoFullPaintInvalidation() const { return m_bitfields.shouldDoFullPaintInvalidation(); } |
- void setShouldDoFullPaintInvalidation(bool b) { m_bitfields.setShouldDoFullPaintInvalidation(b); } |
+ void setShouldDoFullPaintInvalidation(bool); |
+ |
bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInvalidateOverflowForPaint(); } |
bool shouldDoFullPaintInvalidationIfSelfPaintingLayer() const { return m_bitfields.shouldDoFullPaintInvalidationIfSelfPaintingLayer(); } |
@@ -1011,10 +1017,10 @@ public: |
// layoutDidGetCalled indicates whether this render object was re-laid-out |
// since the last call to setLayoutDidGetCalled(false) on this object. |
- bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); } |
+ bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } |
void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } |
- bool mayNeedPaintInvalidation() { return m_bitfields.mayNeedPaintInvalidation(); } |
+ bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInvalidation(); } |
void setMayNeedPaintInvalidation(bool b) |
{ |
m_bitfields.setMayNeedPaintInvalidation(b); |
@@ -1027,9 +1033,13 @@ public: |
bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayoutBecauseOfChildren(); } |
void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutBecauseOfChildren(b); } |
- bool shouldCheckForPaintInvalidation() |
+ bool shouldCheckForSelfOrChildPaintInvalidation() const |
{ |
- return layoutDidGetCalled() || mayNeedPaintInvalidation(); |
+ return m_bitfields.childNeedsPaintInvalidation() || shouldCheckForPaintInvalidation(); |
+ } |
+ bool shouldCheckForPaintInvalidation() const |
+ { |
+ return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation(); |
} |
bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } |
@@ -1095,6 +1105,8 @@ protected: |
void incrementallyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds); |
void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds); |
+ void setChildNeedsPaintInvalidation(bool b) { m_bitfields.setChildNeedsPaintInvalidation(true); } |
+ |
private: |
const RenderLayerModelObject* enclosingCompositedContainer() const; |
@@ -1156,6 +1168,7 @@ private: |
// FIXME: We should remove mayNeedPaintInvalidation once we are able to |
// use the other layout flags to detect the same cases. crbug.com/370118 |
, m_mayNeedPaintInvalidation(false) |
+ , m_childNeedsPaintInvalidation(false) |
, m_onlyNeededPositionedMovementLayout(false) |
, m_neededLayoutBecauseOfChildren(false) |
, m_needsPositionedMovementLayout(false) |
@@ -1197,6 +1210,7 @@ private: |
ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint); |
ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, ShouldDoFullPaintInvalidationIfSelfPaintingLayer); |
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation); |
+ ADD_BOOLEAN_BITFIELD(childNeedsPaintInvalidation, ChildNeedsPaintInvalidation); |
ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPositionedMovementLayout); |
ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren); |
ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout); |