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

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

Issue 620553009: Move selection invalidations to the invalidation phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after review comments. 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
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 5f1b917a328edec2ab2e713e8cb330761436399a..cfdd70e5fe075efe992f9802ff74537f37b2a04a 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -863,6 +863,8 @@ public:
// Invalidate the paint of a specific subrectangle within a given object. The rect |r| is in the object's coordinate space.
void invalidatePaintRectangle(const LayoutRect&) const;
+ void invalidateSelectionIfNeeded(const RenderLayerModelObject&);
+
// 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&);
@@ -1055,17 +1057,28 @@ public:
markContainingBlockChainForPaintInvalidation();
}
+ bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidateSelection(); }
+ void setShouldInvalidateSelection()
+ {
+ if (!canUpdateSelectionOnRootLineBoxes())
+ return;
+
+ m_bitfields.setShouldInvalidateSelection(true);
+ markContainingBlockChainForPaintInvalidation();
+ }
+ void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelection(false); }
+
bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayoutBecauseOfChildren(); }
void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutBecauseOfChildren(b); }
- bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInvalidationState)
+ bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInvalidationState) const
{
return paintInvalidationState.forceCheckForPaintInvalidation() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
- bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
+ bool shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() const
{
- return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer();
+ return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer() || shouldInvalidateSelection();
}
bool supportsPaintInvalidationStateCachedOffsets() const { return !hasColumns() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); }
@@ -1124,8 +1137,7 @@ protected:
#if ENABLE(ASSERT)
virtual bool paintInvalidationStateIsDirty() const
{
- return layoutDidGetCalled() || shouldDoFullPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer()
- || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChildren() || mayNeedPaintInvalidation();
+ return onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChildren() || shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
}
#endif
@@ -1202,6 +1214,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_shouldInvalidateSelection(false)
, m_onlyNeededPositionedMovementLayout(false)
, m_neededLayoutBecauseOfChildren(false)
, m_needsPositionedMovementLayout(false)
@@ -1239,11 +1252,12 @@ private:
{
}
- // 32 bits have been used in the first word, and 14 in the second.
+ // 32 bits have been used in the first word, and 15 in the second.
ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateOverflowForPaint);
ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, ShouldDoFullPaintInvalidationIfSelfPaintingLayer);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
+ ADD_BOOLEAN_BITFIELD(shouldInvalidateSelection, ShouldInvalidateSelection);
ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPositionedMovementLayout);
ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren);
ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout);

Powered by Google App Engine
This is Rietveld 408576698