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

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

Issue 204843002: Reduce invalidation on children-needs-layout containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: And more and more... Created 6 years, 6 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/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 9f3b2adbf65142ccddcdeb7b93472165664da029..a89ad587d3e1bd2c730e466aa0d024f5dbe79ff9 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -249,6 +249,14 @@ public:
#endif
+ bool skipInvalidationWhenLaidOutChildren() const;
+
+ // FIXME: This could be used when changing the size of a renderer without children to skip some invalidations.
+ bool rendererHasNoBoxEffect() const
+ {
+ return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() && !style()->hasBackground();
+ }
+
// Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
// children.
virtual RenderBlock* firstLineBlock() const;
@@ -530,6 +538,8 @@ public:
bool hasBackground() const { return style()->hasBackground(); }
bool hasEntirelyFixedBackground() const;
+ bool needsLayoutBecauseOfChildren() const { return needsLayout() && !selfNeedsLayout() && !needsPositionedMovementLayout() && !needsSimplifiedNormalFlowLayout(); }
+
bool needsLayout() const
{
return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayout() || m_bitfields.posChildNeedsLayout()
@@ -1011,6 +1021,9 @@ public:
parent()->setMayNeedPaintInvalidation(b);
}
+ bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayoutBecauseOfChildren(); }
+ void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutBecauseOfChildren(b); }
+
bool shouldCheckForPaintInvalidationAfterLayout()
{
return layoutDidGetCalled() || mayNeedPaintInvalidation();
@@ -1145,6 +1158,7 @@ private:
// use the other layout flags to detect the same cases. crbug.com/370118
, m_mayNeedPaintInvalidation(false)
, m_onlyNeededPositionedMovementLayout(false)
+ , m_neededLayoutBecauseOfChildren(false)
, m_needsPositionedMovementLayout(false)
, m_normalChildNeedsLayout(false)
, m_posChildNeedsLayout(false)
@@ -1185,6 +1199,7 @@ private:
ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, ShouldDoFullPaintInvalidationIfSelfPaintingLayer);
ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation);
ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPositionedMovementLayout);
+ ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseOfChildren);
ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout);
ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
@@ -1341,8 +1356,8 @@ inline void RenderObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
inline void RenderObject::clearNeedsLayout()
{
- if (needsPositionedMovementLayoutOnly())
- setOnlyNeededPositionedMovementLayout(true);
+ setOnlyNeededPositionedMovementLayout(needsPositionedMovementLayoutOnly());
+ setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren());
setLayoutDidGetCalled(true);
setSelfNeedsLayout(false);
setEverHadLayout(true);
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698