Chromium Code Reviews| Index: Source/core/rendering/RenderObject.h |
| diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h |
| index 7c12db0fb50a55049e113e373ed17e1465427ea7..09d4353eba19c5578e6bb64d3a1c4f19bb429ce3 100644 |
| --- a/Source/core/rendering/RenderObject.h |
| +++ b/Source/core/rendering/RenderObject.h |
| @@ -628,6 +628,7 @@ public: |
| Element* offsetParent() const; |
| void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0, SubtreeLayoutScope* = 0); |
| + void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayoutScope* = 0); |
| void setNeedsLayoutAndFullRepaint(MarkingBehavior = MarkContainingBlockChain, SubtreeLayoutScope* = 0); |
| void clearNeedsLayout(); |
| void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayoutScope* = 0); |
| @@ -636,6 +637,11 @@ public: |
| void clearPreferredLogicalWidthsDirty(); |
| void invalidateContainerPreferredLogicalWidths(); |
| + void setNeedsLayoutAndPrefWidthsRecalc() |
| + { |
| + setNeedsLayout(); |
| + setPreferredLogicalWidthsDirty(); |
| + } |
| void setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint() |
| { |
| setNeedsLayoutAndFullRepaint(); |
| @@ -1325,7 +1331,9 @@ inline bool RenderObject::isBeforeOrAfterContent() const |
| return isBeforeContent() || isAfterContent(); |
| } |
| -inline void RenderObject::setNeedsLayoutAndFullRepaint(MarkingBehavior markParents, SubtreeLayoutScope* layouter) |
| +// If repaintAfterLayout is enabled, setNeedsLayout() won't cause full repaint as |
| +// setNeedsLayoutAndFullRepaint() does. Otherwise the two methods are identical. |
| +inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLayoutScope* layouter) |
| { |
| ASSERT(!isSetNeedsLayoutForbidden()); |
| bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
| @@ -1336,10 +1344,14 @@ inline void RenderObject::setNeedsLayoutAndFullRepaint(MarkingBehavior markParen |
| } |
| } |
| +inline void RenderObject::setNeedsLayoutAndFullRepaint(MarkingBehavior markParents, SubtreeLayoutScope* layouter) |
| +{ |
| + setNeedsLayout(markParents, layouter); |
| + setShouldDoFullRepaintAfterLayout(true); |
|
Julien - ping for review
2014/05/20 16:33:30
Shouldn't this line check shouldDoRepaintAfterLayo
Xianzhu
2014/05/20 16:47:08
I think the original check avoided calling setNeed
|
| +} |
| + |
| inline void RenderObject::clearNeedsLayout() |
| { |
| - if (!shouldDoFullRepaintAfterLayout()) |
| - setShouldDoFullRepaintAfterLayout(selfNeedsLayout()); |
| if (needsPositionedMovementLayoutOnly()) |
| setOnlyNeededPositionedMovementLayout(true); |
| setLayoutDidGetCalled(true); |