Chromium Code Reviews| Index: Source/core/rendering/RenderObject.h |
| diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h |
| index 7ffb86cf19aca82d227df40ec668be67628ae97a..7d360160784e3603c794b9c5a7d6f424dd23c803 100644 |
| --- a/Source/core/rendering/RenderObject.h |
| +++ b/Source/core/rendering/RenderObject.h |
| @@ -530,7 +530,7 @@ public: |
| bool needsLayout() const |
| { |
| return m_bitfields.selfNeedsLayout() || m_bitfields.normalChildNeedsLayout() || m_bitfields.posChildNeedsLayout() |
| - || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.needsPositionedMovementLayout(); |
| + || m_bitfields.needsSimplifiedNormalFlowLayout() || m_bitfields.needsPositionedMovementLayout() || m_bitfields.needsResizeLayout(); |
| } |
| bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); } |
| @@ -538,13 +538,20 @@ public: |
| bool needsPositionedMovementLayoutOnly() const |
| { |
| return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.selfNeedsLayout() && !m_bitfields.normalChildNeedsLayout() |
| - && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifiedNormalFlowLayout(); |
| + && !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 +623,7 @@ public: |
| void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayoutScope* = 0); |
| void setNeedsPositionedMovementLayout(); |
| void setNeedsSimplifiedNormalFlowLayout(); |
| + void setNeedsResizeLayout(); |
| void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockChain); |
| void clearPreferredLogicalWidthsDirty(); |
| void invalidateContainerPreferredLogicalWidths(); |
| @@ -1115,6 +1123,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 +1161,7 @@ private: |
| ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); |
| ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); |
| ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNormalFlowLayout); |
| + ADD_BOOLEAN_BITFIELD(needsResizeLayout, NeedsResizeLayout); |
| ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidthsDirty); |
| ADD_BOOLEAN_BITFIELD(floating, Floating); |
| @@ -1219,6 +1229,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 setNeedsResizeLayout(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 +1301,7 @@ inline void RenderObject::clearNeedsLayout() |
| setNeedsSimplifiedNormalFlowLayout(false); |
| setNormalChildNeedsLayout(false); |
| setNeedsPositionedMovementLayout(false); |
| + setNeedsResizeLayout(false); |
| setAncestorLineBoxDirty(false); |
| #ifndef NDEBUG |
| checkBlockPositionedObjectsNeedLayout(); |
| @@ -1330,6 +1342,15 @@ inline void RenderObject::setNeedsSimplifiedNormalFlowLayout() |
| } |
| } |
| +inline void RenderObject::setNeedsResizeLayout() |
| +{ |
| + // FIXME: needsResizeLayout is for RenderView for now, but will be applied |
| + // to other RenderObjects in later changes. |
| + ASSERT(isRenderView()); |
| + ASSERT(!isSetNeedsLayoutForbidden()); |
| + setNeedsResizeLayout(true); |
|
esprehn
2014/03/21 20:15:39
Please don't add this overload like this.
Xianzhu
2014/03/21 20:37:15
Done.
(Note: naming of setNeedsResizeLayoutIntern
|
| +} |
| + |
| inline bool RenderObject::preservesNewline() const |
| { |
| if (isSVGInlineText()) |