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

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

Issue 197283038: Add RenderObject::needsResizeLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Not to touch RenderView for now Created 6 years, 9 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') | no next file » | 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 7ffb86cf19aca82d227df40ec668be67628ae97a..a90f130e736d6cd1d40447a0978229e46a945043 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -529,22 +529,41 @@ public:
bool needsLayout() const
{
- return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayout() || m_bitfields.posChildNeedsLayout()
- || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.needsPositionedMovementLayout();
+ return m_bitfields.selfNeedsLayout()
+ || m_bitfields.normalChildNeedsLayout()
+ || m_bitfields.posChildNeedsLayout()
+ || m_bitfields.needsSimplifiedNormalFlowLayout()
+ || m_bitfields.needsPositionedMovementLayout()
+ || m_bitfields.needsResizeLayout();
}
bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); }
bool needsPositionedMovementLayout() const { return m_bitfields.needsPositionedMovementLayout(); }
bool needsPositionedMovementLayoutOnly() const
{
- return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.selfNeedsLayout() && !m_bitfields.normalChildNeedsLayout()
- && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifiedNormalFlowLayout();
+ return m_bitfields.needsPositionedMovementLayout()
+ && !m_bitfields.selfNeedsLayout()
+ && !m_bitfields.normalChildNeedsLayout()
+ && !m_bitfields.posChildNeedsLayout()
+ && !m_bitfields.needsSimplifiedNormalFlowLayout()
+ && !m_bitfields.needsResizeLayout();
}
bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); }
bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimplifiedNormalFlowLayout(); }
bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLayout(); }
+ bool needsResizeLayout() const { return m_bitfields.needsResizeLayout(); }
+ bool needsResizeLayoutOnly() const
+ {
+ return m_bitfields.needsResizeLayout()
+ && !m_bitfields.selfNeedsLayout()
+ && !m_bitfields.normalChildNeedsLayout()
+ && !m_bitfields.posChildNeedsLayout()
+ && !m_bitfields.needsSimplifiedNormalFlowLayout()
+ && !m_bitfields.needsPositionedMovementLayout();
+ }
+
bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogicalWidthsDirty(); }
bool isSelectionBorder() const;
@@ -616,6 +635,7 @@ public:
void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayoutScope* = 0);
void setNeedsPositionedMovementLayout();
void setNeedsSimplifiedNormalFlowLayout();
+ void setNeedsResizeLayout();
void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockChain);
void clearPreferredLogicalWidthsDirty();
void invalidateContainerPreferredLogicalWidths();
@@ -1115,6 +1135,7 @@ private:
, m_normalChildNeedsLayout(false)
, m_posChildNeedsLayout(false)
, m_needsSimplifiedNormalFlowLayout(false)
+ , m_needsResizeLayout(false)
, m_preferredLogicalWidthsDirty(false)
, m_floating(false)
, m_isAnonymous(!node)
@@ -1152,6 +1173,7 @@ private:
ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNormalFlowLayout);
+ ADD_BOOLEAN_BITFIELD(needsResizeLayout, NeedsResizeLayout);
eseidel 2014/04/01 18:25:19 Presumably we have space for this otherwise the Ke
ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidthsDirty);
ADD_BOOLEAN_BITFIELD(floating, Floating);
@@ -1219,6 +1241,7 @@ private:
void setNormalChildNeedsLayout(bool b) { m_bitfields.setNormalChildNeedsLayout(b); }
void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); }
void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
+ void setNeedsResizeLayoutBit(bool b) { m_bitfields.setNeedsResizeLayout(b); }
void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
void setShouldRepaintOverflow(bool b) { m_bitfields.setShouldRepaintOverflow(b); }
@@ -1290,6 +1313,7 @@ inline void RenderObject::clearNeedsLayout()
setNeedsSimplifiedNormalFlowLayout(false);
setNormalChildNeedsLayout(false);
setNeedsPositionedMovementLayout(false);
+ setNeedsResizeLayoutBit(false);
setAncestorLineBoxDirty(false);
#ifndef NDEBUG
checkBlockPositionedObjectsNeedLayout();
@@ -1330,6 +1354,15 @@ inline void RenderObject::setNeedsSimplifiedNormalFlowLayout()
}
}
+inline void RenderObject::setNeedsResizeLayout()
+{
+ bool alreadyNeededLayout = needsResizeLayout();
+ setNeedsResizeLayoutBit(true);
+ ASSERT(!isSetNeedsLayoutForbidden());
+ if (!alreadyNeededLayout)
+ markContainingBlocksForLayout();
+}
+
inline bool RenderObject::preservesNewline() const
{
if (isSVGInlineText())
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698