Move setting of some layout bits to RenderElement
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2013 04:04:35 +0000 (04:04 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2013 04:04:35 +0000 (04:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122256

Reviewed by Andreas Kling.

These bits never apply to RenderText nodes:

normalChildNeedsLayout
posChildNeedsLayout
needsSimplifiedNormalFlowLayout
normalChildNeedsLayout
positionedMovementLayout

The code for setting them can be moved to RenderElement.

Also separated the code paths for setting and clearing the bits and uninlined
everything that is not massively popular.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

69 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/rendering/FlowThreadController.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFieldset.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFrameBase.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderIFrame.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerModelObject.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebCore/rendering/RenderMedia.cpp
Source/WebCore/rendering/RenderMultiColumnBlock.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplica.cpp
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderScrollbar.cpp
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTextControl.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp
Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/svg/SVGClipPathElement.cpp
Source/WebCore/svg/SVGFilterElement.cpp
Source/WebCore/svg/SVGGradientElement.cpp
Source/WebCore/svg/SVGLinearGradientElement.cpp
Source/WebCore/svg/SVGMarkerElement.cpp
Source/WebCore/svg/SVGMaskElement.cpp
Source/WebCore/svg/SVGPatternElement.cpp
Source/WebCore/svg/SVGRadialGradientElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp

index 5d20a09..9d33bac 100644 (file)
@@ -1,3 +1,23 @@
+2013-10-03  Antti Koivisto  <antti@apple.com>
+
+        Move setting of some layout bits to RenderElement
+        https://bugs.webkit.org/show_bug.cgi?id=122256
+
+        Reviewed by Andreas Kling.
+        
+        These bits never apply to RenderText nodes:
+        
+        normalChildNeedsLayout
+        posChildNeedsLayout
+        needsSimplifiedNormalFlowLayout
+        normalChildNeedsLayout
+        positionedMovementLayout
+
+        The code for setting them can be moved to RenderElement.
+
+        Also separated the code paths for setting and clearing the bits and uninlined
+        everything that is not massively popular.
+
 2013-10-03  Sam Weinig  <sam@webkit.org>
 
         Remove shouldRubberBandInDirection from the WKBundlePageUIClient
index e0e6173..05cf4aa 100644 (file)
@@ -203,7 +203,7 @@ void HTMLFrameSetElement::defaultEventHandler(Event* evt)
 bool HTMLFrameSetElement::willRecalcStyle(Style::Change)
 {
     if (needsStyleRecalc() && renderer()) {
-        renderer()->setNeedsLayout(true);
+        renderer()->setNeedsLayout();
         clearNeedsStyleRecalc();
     }
     return true;
index 320c58c..359b4f6 100644 (file)
@@ -344,7 +344,7 @@ void RangeInputType::listAttributeTargetChanged()
     m_tickMarkValuesDirty = true;
     HTMLElement* sliderTrackElement = sliderTrackElementOf(element());
     if (sliderTrackElement->renderer())
-        sliderTrackElement->renderer()->setNeedsLayout(true);
+        sliderTrackElement->renderer()->setNeedsLayout();
 }
 
 void RangeInputType::updateTickMarkValues()
index 63c6bb5..c3a6333 100644 (file)
@@ -179,7 +179,7 @@ void RenderSliderContainer::layout()
     // Force a layout to reset the position of the thumb so the code below doesn't move the thumb to the wrong place.
     // FIXME: Make a custom Render class for the track and move the thumb positioning code there.
     if (track)
-        track->setChildNeedsLayout(true, MarkOnlyThis);
+        track->setChildNeedsLayout(MarkOnlyThis);
 
     RenderFlexibleBox::layout();
 
@@ -217,7 +217,7 @@ void SliderThumbElement::setPositionFromValue()
     // path, we don't actually update the value here. Instead, we poke at the
     // renderer directly to trigger layout.
     if (renderer())
-        renderer()->setNeedsLayout(true);
+        renderer()->setNeedsLayout();
 }
 
 RenderElement* SliderThumbElement::createRenderer(RenderArena& arena, RenderStyle&)
@@ -314,7 +314,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& absolutePoint)
     // FIXME: This is no longer being set from renderer. Consider updating the method name.
     input->setValueFromRenderer(valueString);
     if (renderer())
-        renderer()->setNeedsLayout(true);
+        renderer()->setNeedsLayout();
     input->dispatchFormControlChangeEvent();
 }
 
@@ -335,7 +335,7 @@ void SliderThumbElement::stopDragging()
         frame->eventHandler().setCapturingMouseEventsElement(nullptr);
     m_inDragMode = false;
     if (renderer())
-        renderer()->setNeedsLayout(true);
+        renderer()->setNeedsLayout();
 }
 
 void SliderThumbElement::defaultEventHandler(Event* event)
index 51d1924..b1bb2f0 100644 (file)
@@ -919,7 +919,7 @@ void FrameView::setHeaderHeight(int headerHeight)
     m_headerHeight = headerHeight;
 
     if (RenderView* renderView = this->renderView())
-        renderView->setNeedsLayout(true);
+        renderView->setNeedsLayout();
 }
 
 void FrameView::setFooterHeight(int footerHeight)
@@ -929,7 +929,7 @@ void FrameView::setFooterHeight(int footerHeight)
     m_footerHeight = footerHeight;
 
     if (RenderView* renderView = this->renderView())
-        renderView->setNeedsLayout(true);
+        renderView->setNeedsLayout();
 }
 
 bool FrameView::hasCompositedContent() const
@@ -1187,10 +1187,10 @@ void FrameView::layout(bool allowSubtree)
             HTMLElement* body = document.body();
             if (body && body->renderer()) {
                 if (body->hasTagName(framesetTag) && !frameFlatteningEnabled()) {
-                    body->renderer()->setChildNeedsLayout(true);
+                    body->renderer()->setChildNeedsLayout();
                 } else if (body->hasTagName(bodyTag)) {
                     if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport())
-                        body->renderer()->setChildNeedsLayout(true);
+                        body->renderer()->setChildNeedsLayout();
                 }
             }
 
@@ -1244,9 +1244,9 @@ void FrameView::layout(bool allowSubtree)
                     RenderBox* rootRenderer = document.documentElement() ? document.documentElement()->renderBox() : 0;
                     RenderBox* bodyRenderer = rootRenderer && document.body() ? document.body()->renderBox() : 0;
                     if (bodyRenderer && bodyRenderer->stretchesToViewport())
-                        bodyRenderer->setChildNeedsLayout(true);
+                        bodyRenderer->setChildNeedsLayout();
                     else if (rootRenderer && rootRenderer->stretchesToViewport())
-                        rootRenderer->setChildNeedsLayout(true);
+                        rootRenderer->setChildNeedsLayout();
                 }
             }
         }
@@ -1942,7 +1942,7 @@ void FrameView::setViewportConstrainedObjectsNeedLayout()
         return;
 
     for (auto it = m_viewportConstrainedObjects->begin(), end = m_viewportConstrainedObjects->end(); it != end; ++it)
-        (*it)->setNeedsLayout(true);
+        (*it)->setNeedsLayout();
 }
 
 void FrameView::scrollPositionChangedViaPlatformWidget()
@@ -2375,7 +2375,7 @@ void FrameView::scheduleRelayout()
     // When frame flattening is enabled, the contents of the frame could affect the layout of the parent frames.
     // Also invalidate parent frame starting from the owner element of this frame.
     if (frame().ownerRenderer() && isInChildFrameWithFrameFlattening())
-        frame().ownerRenderer()->setNeedsLayout(true, MarkContainingBlockChain);
+        frame().ownerRenderer()->setNeedsLayout(MarkContainingBlockChain);
 
     int delay = frame().document()->minimumLayoutDelay();
     if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
@@ -2484,7 +2484,7 @@ void FrameView::setNeedsLayout()
     }
 
     if (RenderView* renderView = this->renderView())
-        renderView->setNeedsLayout(true);
+        renderView->setNeedsLayout();
 }
 
 void FrameView::unscheduleRelayout()
index 06db4da..e584127 100644 (file)
@@ -762,7 +762,7 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
 
     if (!m_settings->applyPageScaleFactorInCompositor()) {
         if (document->renderView())
-            document->renderView()->setNeedsLayout(true);
+            document->renderView()->setNeedsLayout();
 
         document->recalcStyle(Style::Force);
 
index 84e03e8..e25ffb1 100644 (file)
@@ -56,7 +56,7 @@ public:
     {
         m_isRenderNamedFlowThreadOrderDirty = dirty;
         if (dirty)
-            m_view->setNeedsLayout(true);
+            m_view->setNeedsLayout();
     }
 
     RenderNamedFlowThread& ensureRenderFlowThreadWithName(const AtomicString&);
index 1fc280a..62b78b0 100644 (file)
@@ -1400,7 +1400,7 @@ void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize
         return;
     // Propagate layout markers only up to the child, as we are still in the middle
     // of a layout pass
-    child->setNormalChildNeedsLayout(true);
+    child->setNormalChildNeedsLayoutBit(true);
     child->markShapeInsideDescendantsForLayout();
     child->layoutIfNeeded();
 }
@@ -1472,7 +1472,7 @@ void RenderBlock::markShapeInsideDescendantsForLayout()
     if (!everHadLayout())
         return;
     if (childrenInline()) {
-        setNeedsLayout(true);
+        setNeedsLayout();
         return;
     }
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
@@ -1592,7 +1592,7 @@ void RenderBlock::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalH
 void RenderBlock::layoutBlock(bool, LayoutUnit)
 {
     ASSERT_NOT_REACHED();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderBlock::addOverflowFromChildren()
@@ -1940,7 +1940,7 @@ void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, R
     // FIXME: Technically percentage height objects only need a relayout if their percentage isn't going to be turned into
     // an auto value. Add a method to determine this, so that we can avoid the relayout.
     if (relayoutChildren || (child->hasRelativeLogicalHeight() && !isRenderView()) || child->hasViewportPercentageLogicalHeight())
-        child->setChildNeedsLayout(true, MarkOnlyThis);
+        child->setChildNeedsLayout(MarkOnlyThis);
 
     // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
     if (relayoutChildren && child->needsPreferredWidthsRecalculation())
@@ -1962,7 +1962,7 @@ void RenderBlock::dirtyForLayoutFromPercentageHeightDescendants()
         while (box != this) {
             if (box->normalChildNeedsLayout())
                 break;
-            box->setChildNeedsLayout(true, MarkOnlyThis);
+            box->setChildNeedsLayout(MarkOnlyThis);
             
             // If the width of an image is affected by the height of a child (e.g., an image with an aspect ratio),
             // then we have to dirty preferred widths, since even enclosing blocks can become dirty as a result.
@@ -1989,7 +1989,7 @@ void RenderBlock::simplifiedNormalFlowLayout()
                 if (toRenderBox(o)->inlineBoxWrapper())
                     lineBoxes.add(&toRenderBox(o)->inlineBoxWrapper()->root());
             } else if (o->isText() || (o->isRenderInline() && !walker.atEndOfInline()))
-                o->setNeedsLayout(false);
+                o->clearNeedsLayout();
         }
 
         // FIXME: Glyph overflow will get lost in this case, but not really a big deal.
@@ -2051,7 +2051,7 @@ bool RenderBlock::simplifiedLayout()
 
     updateScrollInfoAfterLayout();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
     return true;
 }
 
@@ -2077,12 +2077,12 @@ void RenderBlock::markFixedPositionObjectForLayoutIfNeeded(RenderObject* child)
         box->computeLogicalWidthInRegion(computedValues);
         LayoutUnit newLeft = computedValues.m_position;
         if (newLeft != box->logicalLeft())
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            box->setChildNeedsLayout(MarkOnlyThis);
     } else if (hasStaticBlockPosition) {
         LayoutUnit oldTop = box->logicalTop();
         box->updateLogicalHeight();
         if (box->logicalTop() != oldTop)
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            box->setChildNeedsLayout(MarkOnlyThis);
     }
 }
 
@@ -2116,7 +2116,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPosit
         // objects that are positioned implicitly like this.  Such objects are rare, and so in typical DHTML menu usage (where everything is
         // positioned explicitly) this should not incur a performance penalty.
         if (relayoutChildren || (r->style()->hasStaticBlockPosition(isHorizontalWritingMode()) && r->parent() != this))
-            r->setChildNeedsLayout(true, MarkOnlyThis);
+            r->setChildNeedsLayout(MarkOnlyThis);
             
         // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
         if (relayoutChildren && r->needsPreferredWidthsRecalculation())
@@ -2128,7 +2128,7 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPosit
         // We don't have to do a full layout.  We just have to update our position. Try that first. If we have shrink-to-fit width
         // and we hit the available width constraint, the layoutIfNeeded() will catch it and do a full layout.
         if (r->needsPositionedMovementLayoutOnly() && r->tryLayoutDoingPositionedMovementOnly())
-            r->setNeedsLayout(false);
+            r->clearNeedsLayout();
             
         // If we are paginated or in a line grid, go ahead and compute a vertical position for our object now.
         // If it's wrong we'll lay out again.
@@ -2146,12 +2146,12 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPosit
 
         // Lay out again if our estimate was wrong.
         if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) {
-            r->setChildNeedsLayout(true, MarkOnlyThis);
+            r->setChildNeedsLayout(MarkOnlyThis);
             r->layoutIfNeeded();
         }
 
         if (updateRegionRangeForBoxChild(r)) {
-            r->setNeedsLayout(true, MarkOnlyThis);
+            r->setNeedsLayout(MarkOnlyThis);
             r->layoutIfNeeded();
         }
     }
@@ -2168,7 +2168,7 @@ void RenderBlock::markPositionedObjectsForLayout()
         TrackedRendererListHashSet::iterator end = positionedDescendants->end();
         for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); it != end; ++it) {
             r = *it;
-            r->setChildNeedsLayout(true);
+            r->setChildNeedsLayout();
         }
     }
 }
@@ -2180,7 +2180,7 @@ void RenderBlock::markForPaginationRelayoutIfNeeded()
         return;
 
     if (view().layoutState()->pageLogicalHeightChanged() || (view().layoutState()->pageLogicalHeight() && view().layoutState()->pageLogicalOffset(this, logicalTop()) != pageLogicalOffset()))
-        setChildNeedsLayout(true, MarkOnlyThis);
+        setChildNeedsLayout(MarkOnlyThis);
 }
 
 void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants)
@@ -3238,15 +3238,15 @@ void RenderBlock::removePositionedObjects(RenderBlock* o, ContainingBlockState c
         r = *it;
         if (!o || r->isDescendantOf(o)) {
             if (containingBlockState == NewContainingBlock)
-                r->setChildNeedsLayout(true, MarkOnlyThis);
+                r->setChildNeedsLayout(MarkOnlyThis);
             
             // It is parent blocks job to add positioned child to positioned objects list of its containing block
             // Parent layout needs to be invalidated to ensure this happens.
-            RenderObject* p = r->parent();
+            RenderElement* p = r->parent();
             while (p && !p->isRenderBlock())
                 p = p->parent();
             if (p)
-                p->setChildNeedsLayout(true);
+                p->setChildNeedsLayout();
             
             deadObjects.append(r);
         }
@@ -3287,7 +3287,7 @@ FloatingObject* RenderBlock::insertFloatingObject(RenderBox* o)
     // Just go ahead and lay out the float.
     bool isChildRenderBlock = o->isRenderBlock();
     if (isChildRenderBlock && !o->needsLayout() && view().layoutState()->pageLogicalHeightChanged())
-        o->setChildNeedsLayout(true, MarkOnlyThis);
+        o->setChildNeedsLayout(MarkOnlyThis);
             
     bool needsBlockDirectionLocationSetBeforeLayout = isChildRenderBlock && view().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
     if (!needsBlockDirectionLocationSetBeforeLayout || isWritingModeRoot()) // We are unsplittable if we're a block flow root.
@@ -3523,12 +3523,12 @@ bool RenderBlock::positionNewFloats()
                 setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox));
         
                 if (childBlock)
-                    childBlock->setChildNeedsLayout(true, MarkOnlyThis);
+                    childBlock->setChildNeedsLayout(MarkOnlyThis);
                 childBox->layoutIfNeeded();
             }
 
             if (updateRegionRangeForBoxChild(childBox)) {
-                childBox->setNeedsLayout(true, MarkOnlyThis);
+                childBox->setNeedsLayout(MarkOnlyThis);
                 childBox->layoutIfNeeded();
             }
         }
@@ -3931,7 +3931,7 @@ void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove
         return;
 
     MarkingBehavior markParents = inLayout ? MarkOnlyThis : MarkContainingBlockChain;
-    setChildNeedsLayout(true, markParents);
+    setChildNeedsLayout(markParents);
  
     if (floatToRemove)
         removeFloatingObject(floatToRemove);
@@ -4029,7 +4029,7 @@ LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit logicalTop)
                 // we need to force a relayout as though we shifted. This happens because of the dynamic addition of overhanging floats
                 // from previous siblings when negative margins exist on a child (see the addOverhangingFloats call at the end of collapseMargins).
                 if (childLogicalWidthAtOldLogicalTopOffset != childLogicalWidthAtNewLogicalTopOffset)
-                    child->setChildNeedsLayout(true, MarkOnlyThis);
+                    child->setChildNeedsLayout(MarkOnlyThis);
                 return newLogicalTop - logicalTop;
             }
 
index a55b2a5..fd35334 100644 (file)
@@ -392,7 +392,7 @@ void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalH
         }
     }
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderBlockFlow::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalBottom)
@@ -536,7 +536,7 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo,
             // When the child shifts to clear an item, its width can
             // change (because it has more available line width).
             // So go ahead and mark the item as dirty.
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
         }
         
         if (childBlockFlow) {
@@ -551,7 +551,7 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo,
     }
 
     if (updateRegionRangeForBoxChild(child)) {
-        child->setNeedsLayout(true, MarkOnlyThis);
+        child->setNeedsLayout(MarkOnlyThis);
         child->layoutIfNeeded();
     }
 
@@ -624,7 +624,7 @@ void RenderBlockFlow::adjustPositionedBlock(RenderBox* child, const MarginInfo&
     if (childLayer->staticBlockPosition() != logicalTop) {
         childLayer->setStaticBlockPosition(logicalTop);
         if (hasStaticBlockPosition)
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
     }
 }
 
@@ -1265,7 +1265,7 @@ LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA
             // When the child shifts to clear an item, its width can
             // change (because it has more available line width).
             // So go ahead and mark the item as dirty.
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
         }
         
         if (childRenderBlock) {
index a5279d4..1b5b39b 100644 (file)
@@ -1273,7 +1273,7 @@ void RenderBlock::layoutRunsAndFloats(LineLayoutState& layoutState, bool hasInli
     // determineStartPosition can change the fullLayout flag we have to do this here. Failure to call
     // determineStartPosition first will break fast/repaint/line-flow-with-floats-9.html.
     if (layoutState.isFullLayout() && hasInlineChild && !selfNeedsLayout()) {
-        setNeedsLayout(true, MarkOnlyThis); // Mark as needing a full layout to force us to repaint.
+        setNeedsLayout(MarkOnlyThis); // Mark as needing a full layout to force us to repaint.
         if (!view().doingFullRepaint() && hasLayer()) {
             // Because we waited until we were already inside layout to discover
             // that the block really needed a full layout, we missed our chance to repaint the layer
@@ -1874,7 +1874,7 @@ void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& re
                 RenderBox* box = toRenderBox(o);
 
                 if (relayoutChildren || box->hasRelativeDimensions())
-                    o->setChildNeedsLayout(true, MarkOnlyThis);
+                    box->setChildNeedsLayout(MarkOnlyThis);
 
                 // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
                 if (relayoutChildren && box->needsPreferredWidthsRecalculation())
@@ -1897,7 +1897,7 @@ void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& re
                     toRenderInline(o)->updateAlwaysCreateLineBoxes(layoutState.isFullLayout());
                 if (layoutState.isFullLayout() || o->selfNeedsLayout())
                     dirtyLineBoxesForRenderer(o, layoutState.isFullLayout());
-                o->setNeedsLayout(false);
+                o->clearNeedsLayout();
             }
         }
 
@@ -3461,7 +3461,7 @@ bool RenderBlock::positionNewFloatOnLine(FloatingObject* newFloat, FloatingObjec
             RenderBox* o = &f->renderer();
             setLogicalTopForChild(o, logicalTopForChild(o) + marginBeforeForChild(o) + paginationStrut);
             if (o->isRenderBlock())
-                toRenderBlock(o)->setChildNeedsLayout(true, MarkOnlyThis);
+                toRenderBlock(o)->setChildNeedsLayout(MarkOnlyThis);
             o->layoutIfNeeded();
             // Save the old logical top before calling removePlacedObject which will set
             // isPlaced to false. Otherwise it will trigger an assert in logicalTopForFloat.
index 2ea3dac..7703bf7 100644 (file)
@@ -283,7 +283,7 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
             if (oldStyle->position() == StaticPosition)
                 repaint();
             else if (newStyle->hasOutOfFlowPosition())
-                parent()->setChildNeedsLayout(true);
+                parent()->setChildNeedsLayout();
             if (isFloating() && !isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition())
                 removeFloatingOrPositionedChildFromBlockLists();
         }
@@ -311,7 +311,7 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
         // to determine the new static position.
         if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition(isHorizontalWritingMode()) && oldStyle->marginBefore() != newStyle->marginBefore()
             && parent() && !parent()->normalChildNeedsLayout())
-            parent()->setChildNeedsLayout(true);
+            parent()->setChildNeedsLayout();
     }
 
     if (RenderBlock::hasPercentHeightContainerMap() && firstChild()
@@ -450,7 +450,7 @@ void RenderBox::layout()
 
     RenderObject* child = firstChild();
     if (!child) {
-        setNeedsLayout(false);
+        clearNeedsLayout();
         return;
     }
 
@@ -462,7 +462,7 @@ void RenderBox::layout()
     }
     statePusher.pop();
     invalidateBackgroundObscurationStatus();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 // More IE extensions.  clientWidth and clientHeight represent the interior of an object
@@ -1962,7 +1962,7 @@ void RenderBox::positionLineBox(InlineBox* box)
             RootInlineBox& rootBox = box->root();
             rootBox.block().setStaticInlinePositionForChild(this, rootBox.lineTopWithLeading(), roundedLayoutUnit(box->logicalLeft()));
             if (style()->hasStaticInlinePosition(box->isHorizontal()))
-                setChildNeedsLayout(true, MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
+                setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
         } else {
             // Our object was a block originally, so we make our normal flow position be
             // just below the line box (as though all the inlines that came before us got
@@ -1970,7 +1970,7 @@ void RenderBox::positionLineBox(InlineBox* box)
             // in flow).  This value was cached in the y() of the box.
             layer()->setStaticBlockPosition(box->logicalTop());
             if (style()->hasStaticBlockPosition(box->isHorizontal()))
-                setChildNeedsLayout(true, MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
+                setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
         }
 
         // Nuke the box.
index 5cdc16a..28bc130 100644 (file)
@@ -351,7 +351,7 @@ void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit)
     // Repaint with our new bounds if they are different from our old bounds.
     repainter.repaintAfterLayout();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 // The first walk over our kids is to find out if we have any flexible children.
@@ -364,7 +364,7 @@ static void gatherFlexChildrenInfo(FlexBoxIterator& iterator, bool relayoutChild
             // may have changed, and we need to reallocate space.
             child->clearOverrideSize();
             if (!relayoutChildren)
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
             haveFlex = true;
             unsigned int flexGroup = child->style()->boxFlexGroup();
             if (lowestFlexGroup == 0)
@@ -425,7 +425,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
         LayoutUnit maxAscent = 0, maxDescent = 0;
         for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
             if (relayoutChildren)
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
 
             if (child->isOutOfFlowPositioned())
                 continue;
@@ -489,7 +489,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
                 if (childLayer->staticBlockPosition() != yPos) {
                     childLayer->setStaticBlockPosition(yPos);
                     if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
-                        child->setChildNeedsLayout(true, MarkOnlyThis);
+                        child->setChildNeedsLayout(MarkOnlyThis);
                 }
                 continue;
             }
@@ -509,7 +509,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
             LayoutUnit oldChildHeight = child->height();
             child->updateLogicalHeight();
             if (oldChildHeight != child->height())
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
 
             if (!child->needsLayout())
                 child->markForPaginationRelayoutIfNeeded();
@@ -727,7 +727,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
         for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
             // Make sure we relayout children if we need it.
             if (!haveLineClamp && relayoutChildren)
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
 
             if (child->isOutOfFlowPositioned()) {
                 child->containingBlock()->insertPositionedObject(child);
@@ -736,7 +736,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
                 if (childLayer->staticBlockPosition() != height()) {
                     childLayer->setStaticBlockPosition(height());
                     if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
-                        child->setChildNeedsLayout(true, MarkOnlyThis);
+                        child->setChildNeedsLayout(MarkOnlyThis);
                 }
                 continue;
             }
@@ -955,7 +955,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
         child->clearOverrideSize();
         if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
             || (child->style()->height().isAuto() && child->isRenderBlock())) {
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
 
             // Dirty all the positioned objects.
             if (child->isRenderBlock()) {
@@ -988,7 +988,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
         if (newHeight == child->height())
             continue;
 
-        child->setChildNeedsLayout(true, MarkOnlyThis);
+        child->setChildNeedsLayout(MarkOnlyThis);
         child->setOverrideLogicalContentHeight(newHeight - child->borderAndPaddingHeight());
         child->layoutIfNeeded();
 
@@ -1055,7 +1055,7 @@ void RenderDeprecatedFlexibleBox::clearLineClamp()
         child->clearOverrideSize();
         if ((child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
             || (child->style()->height().isAuto() && child->isRenderBlock())) {
-            child->setChildNeedsLayout(true);
+            child->setChildNeedsLayout();
 
             if (child->isRenderBlock()) {
                 toRenderBlock(child)->markPositionedObjectsForLayout();
index ca5c516..bacdf8a 100644 (file)
@@ -558,7 +558,7 @@ void RenderElement::insertChildInternal(RenderObject* newChild, RenderObject* be
     newChild->setNeedsLayoutAndPrefWidthsRecalc();
     setPreferredLogicalWidthsDirty(true);
     if (!normalChildNeedsLayout())
-        setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.
+        setChildNeedsLayout(); // We may supply the static position for an absolute positioned child.
 
     if (AXObjectCache* cache = document().axObjectCache())
         cache->childrenChanged(this);
@@ -995,6 +995,41 @@ void RenderElement::willBeDestroyed()
     RenderObject::willBeDestroyed();
 }
 
+void RenderElement::setNeedsPositionedMovementLayout(const RenderStyle* oldStyle)
+{
+    ASSERT(!isSetNeedsLayoutForbidden());
+    if (needsPositionedMovementLayout())
+        return;
+    setNeedsPositionedMovementLayoutBit(true);
+    markContainingBlocksForLayout();
+    if (hasLayer()) {
+        if (oldStyle && style()->diffRequiresRepaint(oldStyle))
+            setLayerNeedsFullRepaint();
+        else
+            setLayerNeedsFullRepaintForPositionedMovementLayout();
+    }
+}
+
+void RenderElement::clearChildNeedsLayout()
+{
+    setNormalChildNeedsLayoutBit(false);
+    setPosChildNeedsLayoutBit(false);
+    setNeedsSimplifiedNormalFlowLayoutBit(false);
+    setNormalChildNeedsLayoutBit(false);
+    setNeedsPositionedMovementLayoutBit(false);
+}
+
+void RenderElement::setNeedsSimplifiedNormalFlowLayout()
+{
+    ASSERT(!isSetNeedsLayoutForbidden());
+    if (needsSimplifiedNormalFlowLayout())
+        return;
+    setNeedsSimplifiedNormalFlowLayoutBit(true);
+    markContainingBlocksForLayout();
+    if (hasLayer())
+        setLayerNeedsFullRepaint();
+}
+
 RenderElement* RenderElement::rendererForRootBackground()
 {
     ASSERT(isRoot());
index 5dd37bf..1fc58b0 100644 (file)
@@ -82,6 +82,11 @@ public:
     bool ancestorLineBoxDirty() const { return m_ancestorLineBoxDirty; }
     void setAncestorLineBoxDirty(bool f = true);
 
+    void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain);
+    void clearChildNeedsLayout();
+    void setNeedsPositionedMovementLayout(const RenderStyle* oldStyle);
+    void setNeedsSimplifiedNormalFlowLayout();
+
     // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true.
     RenderElement* rendererForRootBackground();
 
@@ -169,7 +174,17 @@ inline void RenderElement::setAncestorLineBoxDirty(bool f)
 {
     m_ancestorLineBoxDirty = f;
     if (m_ancestorLineBoxDirty)
-        setNeedsLayout(true);
+        setNeedsLayout();
+}
+
+inline void RenderElement::setChildNeedsLayout(MarkingBehavior markParents)
+{
+    ASSERT(!isSetNeedsLayoutForbidden());
+    if (normalChildNeedsLayout())
+        return;
+    setNormalChildNeedsLayoutBit(true);
+    if (markParents == MarkContainingBlockChain)
+        markContainingBlocksForLayout();
 }
 
 inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) const
@@ -284,32 +299,6 @@ inline RenderStyle* RenderObject::firstLineStyle() const
     return toRenderElement(this)->firstLineStyle();
 }
 
-inline void RenderObject::setNeedsLayout(bool needsLayout, MarkingBehavior markParents)
-{
-    bool alreadyNeededLayout = m_bitfields.needsLayout();
-    m_bitfields.setNeedsLayout(needsLayout);
-    if (needsLayout) {
-        ASSERT(!isSetNeedsLayoutForbidden());
-        if (!alreadyNeededLayout) {
-            if (markParents == MarkContainingBlockChain)
-                markContainingBlocksForLayout();
-            if (hasLayer())
-                setLayerNeedsFullRepaint();
-        }
-    } else {
-        setEverHadLayout(true);
-        setPosChildNeedsLayout(false);
-        setNeedsSimplifiedNormalFlowLayout(false);
-        setNormalChildNeedsLayout(false);
-        setNeedsPositionedMovementLayout(false);
-        if (isRenderElement())
-            toRenderElement(this)->setAncestorLineBoxDirty(false);
-#ifndef NDEBUG
-        checkBlockPositionedObjectsNeedLayout();
-#endif
-    }
-}
-
 inline RenderElement* ContainerNode::renderer() const
 {
     return toRenderElement(Node::renderer());
index 33e954b..bd7674f 100644 (file)
@@ -475,7 +475,7 @@ void RenderEmbeddedObject::layout()
         view().frameView().addEmbeddedObjectToUpdate(*this);
     }
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 
     LayoutSize newSize = contentBoxRect().size();
 
@@ -515,9 +515,9 @@ void RenderEmbeddedObject::layout()
     childBox->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
     childBox->style()->setHeight(Length(newSize.height(), Fixed));
     childBox->style()->setWidth(Length(newSize.width(), Fixed));
-    childBox->setNeedsLayout(true, MarkOnlyThis);
+    childBox->setNeedsLayout(MarkOnlyThis);
     childBox->layout();
-    setChildNeedsLayout(false);
+    clearChildNeedsLayout();
     
     statePusher.pop();
 }
index bcc32bb..950a3c0 100644 (file)
@@ -66,7 +66,7 @@ RenderObject* RenderFieldset::layoutSpecialExcludedChild(bool relayoutChildren)
     RenderBox* legend = findLegend();
     if (legend) {
         if (relayoutChildren)
-            legend->setNeedsLayout(true);
+            legend->setNeedsLayout();
         legend->layoutIfNeeded();
 
         LayoutUnit logicalLeft;
index 940ec2b..0fd2acd 100644 (file)
@@ -316,7 +316,7 @@ void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle*
         for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
             EAlignItems previousAlignment = resolveAlignment(oldStyle, child->style());
             if (previousAlignment == AlignStretch && previousAlignment != resolveAlignment(style(), child->style()))
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
         }
     }
 }
@@ -385,7 +385,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren, LayoutUnit)
 
     repainter.repaintAfterLayout();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderFlexibleBox::appendChildFrameRects(ChildFrameRects& childFrameRects)
@@ -751,7 +751,7 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox*
     if (flexBasis.isAuto() || (flexBasis.isFixed() && !flexBasis.value() && hasInfiniteLineLength)) {
         if (hasOrthogonalFlow(child)) {
             if (hasOverrideSize)
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
             child->layoutIfNeeded();
         }
         LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth();
@@ -1097,7 +1097,7 @@ void RenderFlexibleBox::prepareChildForPositionedLayout(RenderBox* child, Layout
     if (childLayer->staticBlockPosition() != staticBlockPosition) {
         childLayer->setStaticBlockPosition(staticBlockPosition);
         if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
     }
 }
 
@@ -1171,7 +1171,7 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
         setLogicalOverrideSize(child, childPreferredSize);
         // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
         if (needToStretchChild(child) || childPreferredSize != mainAxisExtentForChild(child))
-            child->setChildNeedsLayout(true, MarkOnlyThis);
+            child->setChildNeedsLayout(MarkOnlyThis);
         else {
             // To avoid double applying margin changes in updateAutoMarginsInCrossAxis, we reset the margins here.
             resetAutoMarginsAndLogicalTopInCrossAxis(child);
@@ -1405,7 +1405,7 @@ void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUni
             if (desiredLogicalHeight != child->logicalHeight()) {
                 child->setOverrideLogicalContentHeight(desiredLogicalHeight - child->borderAndPaddingLogicalHeight());
                 child->setLogicalHeight(0);
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
                 child->layout();
             }
         }
@@ -1417,7 +1417,7 @@ void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUni
 
             if (childWidth != child->logicalWidth()) {
                 child->setOverrideLogicalContentWidth(childWidth - child->borderAndPaddingLogicalWidth());
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                child->setChildNeedsLayout(MarkOnlyThis);
                 child->layout();
             }
         }
index c95a7d8..b6bfc3d 100644 (file)
@@ -126,7 +126,7 @@ void RenderFlowThread::invalidateRegions()
     m_regionRangeMap.clear();
     m_breakBeforeToRegionMap.clear();
     m_breakAfterToRegionMap.clear();
-    setNeedsLayout(true);
+    setNeedsLayout();
 
     m_regionsInvalidated = true;
 }
@@ -965,7 +965,7 @@ void RenderFlowThread::markAutoLogicalHeightRegionsForLayout()
 
         // FIXME: We need to find a way to avoid marking all the regions ancestors for layout
         // as we are already inside layout.
-        region->setNeedsLayout(true);
+        region->setNeedsLayout();
     }
 }
 
index 3b1c68f..81c3007 100644 (file)
@@ -61,7 +61,7 @@ void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeig
         updateWidgetPosition();
         if (childFrameView)
             childFrameView->layout();
-        setNeedsLayout(false);
+        clearNeedsLayout();
         return;
     }
 
@@ -98,7 +98,7 @@ void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeig
     ASSERT(!childRoot->needsLayout());
     ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChildSlow() || !childRoot->firstChild()->firstChildSlow()->needsLayout());
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 }
index 1d40bc3..a34068e 100644 (file)
@@ -488,7 +488,7 @@ void RenderFrameSet::layout()
             repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds));
     }
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderFrameSet::positionFrames()
@@ -513,7 +513,7 @@ void RenderFrameSet::positionFrames()
             if (width != child->width() || height != child->height()) {
                 child->setWidth(width);
                 child->setHeight(height);
-                child->setNeedsLayout(true);
+                child->setNeedsLayout();
                 child->layout();
             }
 
@@ -530,7 +530,7 @@ void RenderFrameSet::positionFrames()
     for (; child; child = child->nextSiblingBox()) {
         child->setWidth(0);
         child->setHeight(0);
-        child->setNeedsLayout(false);
+        child->clearNeedsLayout();
     }
 }
 
@@ -567,7 +567,7 @@ void RenderFrameSet::positionFramesWithFlattening()
                 child->setWidth(width);
             child->setHeight(height);
 
-            child->setNeedsLayout(true);
+            child->setNeedsLayout();
 
             if (child->isFrameSet())
                 toRenderFrameSet(child)->layout();
@@ -611,7 +611,7 @@ void RenderFrameSet::positionFramesWithFlattening()
                 repaintNeeded = true;
 
                 // update to final size
-                child->setNeedsLayout(true);
+                child->setNeedsLayout();
                 if (child->isFrameSet())
                     toRenderFrameSet(child)->layout();
                 else
@@ -638,7 +638,7 @@ void RenderFrameSet::positionFramesWithFlattening()
     for (; child; child = child->nextSiblingBox()) {
         child->setWidth(0);
         child->setHeight(0);
-        child->setNeedsLayout(false);
+        child->clearNeedsLayout();
     }
 }
 
@@ -670,7 +670,7 @@ void RenderFrameSet::continueResizing(GridAxis& axis, int position)
         return;
     axis.m_deltas[axis.m_splitBeingResized - 1] += delta;
     axis.m_deltas[axis.m_splitBeingResized] -= delta;
-    setNeedsLayout(true);
+    setNeedsLayout();
 }
 
 bool RenderFrameSet::userResize(MouseEvent* evt)
index 8ad89b1..4b4c78e 100644 (file)
@@ -184,7 +184,7 @@ void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit)
 
     repainter.repaintAfterLayout();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
@@ -367,7 +367,7 @@ LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<Gri
     // doesn't return if the logical height is available so would need to be changed.
     // 2) Relayout if the column track's used breadth changed OR the logical height is unavailable.
     if (!child->needsLayout())
-        child->setNeedsLayout(true, MarkOnlyThis);
+        child->setNeedsLayout(MarkOnlyThis);
 
     child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild(child, ForColumns, columnTracks));
     // If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is
@@ -674,7 +674,7 @@ void RenderGrid::layoutGridItems()
         LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
         LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, rowTracks);
         if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight)
-            child->setNeedsLayout(true, MarkOnlyThis);
+            child->setNeedsLayout(MarkOnlyThis);
 
         child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
         child->setOverrideContainingBlockContentLogicalHeight(overrideContainingBlockContentLogicalHeight);
index 2ad5473..8290809 100644 (file)
@@ -111,7 +111,7 @@ void RenderHTMLCanvas::canvasSizeChanged()
         return;
 
     if (!selfNeedsLayout())
-        setNeedsLayout(true);
+        setNeedsLayout();
 }
 
 } // namespace WebCore
index 84594f8..0a3af99 100644 (file)
@@ -173,7 +173,7 @@ void RenderIFrame::layout()
     addVisualEffectOverflow();
     updateLayerTransform();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 }
index b16e66c..20bcf97 100644 (file)
@@ -262,7 +262,7 @@ void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* r
         if (imageSizeChanged || hasOverrideSize || containingBlockNeedsToRecomputePreferredSize) {
             shouldRepaint = false;
             if (!selfNeedsLayout())
-                setNeedsLayout(true);
+                setNeedsLayout();
         }
 
         if (everHadLayout() && !selfNeedsLayout()) {
index 330b810..97b5d70 100644 (file)
@@ -197,7 +197,7 @@ void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
         bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || newStyle->hasPadding() || newStyle->hasMargin() || hasOutline();
         if (oldStyle && alwaysCreateLineBoxes) {
             dirtyLineBoxes(false);
-            setNeedsLayout(true);
+            setNeedsLayout();
         }
         m_alwaysCreateLineBoxes = alwaysCreateLineBoxes;
     }
index 150f505..99dd2d3 100644 (file)
@@ -3159,7 +3159,7 @@ void RenderLayer::updateScrollbarsAfterLayout()
             if (!m_inOverflowRelayout) {
                 // Our proprietary overflow: overlay value doesn't trigger a layout.
                 m_inOverflowRelayout = true;
-                renderer().setNeedsLayout(true, MarkOnlyThis);
+                renderer().setNeedsLayout(MarkOnlyThis);
                 if (renderer().isRenderBlock()) {
                     RenderBlock& block = toRenderBlock(renderer());
                     block.scrollbarsChanged(autoHorizontalScrollBarChanged, autoVerticalScrollBarChanged);
index 8ad28c8..f48b4d6 100644 (file)
@@ -142,7 +142,7 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
     if (requiresLayer()) {
         if (!layer() && layerCreationAllowedForSubtree()) {
             if (s_wasFloating && isFloating())
-                setChildNeedsLayout(true);
+                setChildNeedsLayout();
             ensureLayer();
             if (parent() && !needsLayout() && containingBlock()) {
                 layer()->setRepaintStatus(NeedsFullRepaint);
@@ -156,7 +156,7 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
         setHasReflection(false);
         layer()->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer
         if (s_wasFloating && isFloating())
-            setChildNeedsLayout(true);
+            setChildNeedsLayout();
         if (s_hadTransform)
             setNeedsLayoutAndPrefWidthsRecalc();
     }
@@ -164,7 +164,7 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
     if (layer()) {
         layer()->styleChanged(diff, oldStyle);
         if (s_hadLayer && layer()->isSelfPaintingLayer() != s_layerWasSelfPainting)
-            setChildNeedsLayout(true);
+            setChildNeedsLayout();
     }
 
     bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosition();
index 73eb8df..9c59bbc 100644 (file)
@@ -1407,7 +1407,7 @@ void RenderListMarker::layout()
     if (endMargin.isFixed())
         setMarginEnd(endMargin.value());
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderListMarker::imageChanged(WrappedImagePtr o, const IntRect*)
index 0a8899d..7dac87c 100644 (file)
@@ -246,7 +246,7 @@ void RenderMarquee::updateMarqueeStyle()
     // Check the loop count to see if we should now stop.
     bool activate = (m_totalLoops <= 0 || m_currentLoop < m_totalLoops);
     if (activate && !m_timer.isActive())
-        m_layer->renderer().setNeedsLayout(true);
+        m_layer->renderer().setNeedsLayout();
     else if (!activate && m_timer.isActive())
         m_timer.stop();
 }
index d38c5b2..b327e57 100644 (file)
@@ -83,9 +83,9 @@ void RenderMedia::layout()
     controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
     controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
     controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
-    controlsRenderer->setNeedsLayout(true, MarkOnlyThis);
+    controlsRenderer->setNeedsLayout(MarkOnlyThis);
     controlsRenderer->layout();
-    setChildNeedsLayout(false);
+    clearChildNeedsLayout();
 
     statePusher.pop();
 }
index e3da22f..5bb510e 100644 (file)
@@ -116,7 +116,7 @@ bool RenderMultiColumnBlock::relayoutForPagination(bool, LayoutUnit, LayoutState
             if (childBox != m_flowThread && childBox->isRenderMultiColumnSet()) {
                 RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(childBox);
                 if (multicolSet->calculateBalancedHeight(firstPass)) {
-                    multicolSet->setChildNeedsLayout(true, MarkOnlyThis);
+                    multicolSet->setChildNeedsLayout(MarkOnlyThis);
                     needsRelayout = true;
                 }
             }
@@ -124,8 +124,8 @@ bool RenderMultiColumnBlock::relayoutForPagination(bool, LayoutUnit, LayoutState
         if (needsRelayout) {
             // Layout again. Column balancing resulted in a new height.
             neededRelayout = true;
-            m_flowThread->setChildNeedsLayout(true, MarkOnlyThis);
-            setChildNeedsLayout(true, MarkOnlyThis);
+            m_flowThread->setChildNeedsLayout(MarkOnlyThis);
+            setChildNeedsLayout(MarkOnlyThis);
             if (firstPass)
                 statePusher.pop();
             layoutBlock(false);
@@ -170,7 +170,7 @@ RenderObject* RenderMultiColumnBlock::layoutSpecialExcludedChild(bool relayoutCh
         m_flowThread->invalidateRegions();
 
     if (relayoutChildren)
-        m_flowThread->setChildNeedsLayout(true, MarkOnlyThis);
+        m_flowThread->setChildNeedsLayout(MarkOnlyThis);
     
     setLogicalTopForChild(m_flowThread, borderAndPaddingBefore());
     m_flowThread->layoutIfNeeded();
index 5b39cbb..b0e255e 100644 (file)
@@ -619,6 +619,21 @@ static inline bool objectIsRelayoutBoundary(const RenderObject* object)
     return true;
 }
 
+void RenderObject::clearNeedsLayout()
+{
+    m_bitfields.setNeedsLayout(false);
+    setEverHadLayout(true);
+    setPosChildNeedsLayoutBit(false);
+    setNeedsSimplifiedNormalFlowLayoutBit(false);
+    setNormalChildNeedsLayoutBit(false);
+    setNeedsPositionedMovementLayoutBit(false);
+    if (isRenderElement())
+        toRenderElement(this)->setAncestorLineBoxDirty(false);
+#ifndef NDEBUG
+    checkBlockPositionedObjectsNeedLayout();
+#endif
+}
+
 void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderObject* newRoot)
 {
     ASSERT(!scheduleRelayout || !newRoot);
@@ -649,18 +664,18 @@ void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderOb
                 return;
             if (willSkipRelativelyPositionedInlines)
                 container = object->container();
-            object->setPosChildNeedsLayout(true);
+            object->setPosChildNeedsLayoutBit(true);
             simplifiedNormalFlowLayout = true;
             ASSERT(!object->isSetNeedsLayoutForbidden());
         } else if (simplifiedNormalFlowLayout) {
             if (object->needsSimplifiedNormalFlowLayout())
                 return;
-            object->setNeedsSimplifiedNormalFlowLayout(true);
+            object->setNeedsSimplifiedNormalFlowLayoutBit(true);
             ASSERT(!object->isSetNeedsLayoutForbidden());
         } else {
             if (object->normalChildNeedsLayout())
                 return;
-            object->setNormalChildNeedsLayout(true);
+            object->setNormalChildNeedsLayoutBit(true);
             ASSERT(!object->isSetNeedsLayoutForbidden());
         }
 
@@ -2209,7 +2224,7 @@ void RenderObject::layout()
         ASSERT(!child->needsLayout());
         child = child->nextSibling();
     }
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* parentStyle) const
index e43ca07..90c067b 100644 (file)
@@ -617,16 +617,14 @@ public:
     RenderBoxModelObject* offsetParent() const;
 
     void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0);
-    void setNeedsLayout(bool needsLayout, MarkingBehavior = MarkContainingBlockChain);
-    void setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior = MarkContainingBlockChain);
-    void setNeedsPositionedMovementLayout(const RenderStyle* oldStyle);
-    void setNeedsSimplifiedNormalFlowLayout();
+    void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain);
+    void clearNeedsLayout();
     void setPreferredLogicalWidthsDirty(bool, MarkingBehavior = MarkContainingBlockChain);
     void invalidateContainerPreferredLogicalWidths();
     
     void setNeedsLayoutAndPrefWidthsRecalc()
     {
-        setNeedsLayout(true);
+        setNeedsLayout();
         setPreferredLogicalWidthsDirty(true);
     }
 
@@ -941,6 +939,11 @@ protected:
 
     void setDocumentForAnonymous(Document& document) { ASSERT(isAnonymous()); m_node = &document; }
 
+    void setNeedsPositionedMovementLayoutBit(bool b) { m_bitfields.setNeedsPositionedMovementLayout(b); }
+    void setNormalChildNeedsLayoutBit(bool b) { m_bitfields.setNormalChildNeedsLayout(b); }
+    void setPosChildNeedsLayoutBit(bool b) { m_bitfields.setPosChildNeedsLayout(b); }
+    void setNeedsSimplifiedNormalFlowLayoutBit(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
+
 private:
     RenderFlowThread* locateFlowThreadContainingBlock() const;
     void removeFromRenderFlowThread();
@@ -1077,10 +1080,6 @@ private:
 
     RenderObjectBitfields m_bitfields;
 
-    void setNeedsPositionedMovementLayout(bool b) { m_bitfields.setNeedsPositionedMovementLayout(b); }
-    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 setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
     void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
 };
@@ -1115,48 +1114,16 @@ inline bool RenderObject::isBeforeOrAfterContent() const
     return isBeforeContent() || isAfterContent();
 }
 
-inline void RenderObject::setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior markParents)
-{
-    bool alreadyNeededLayout = normalChildNeedsLayout();
-    setNormalChildNeedsLayout(childNeedsLayout);
-    if (childNeedsLayout) {
-        ASSERT(!isSetNeedsLayoutForbidden());
-        if (!alreadyNeededLayout && markParents == MarkContainingBlockChain)
-            markContainingBlocksForLayout();
-    } else {
-        setPosChildNeedsLayout(false);
-        setNeedsSimplifiedNormalFlowLayout(false);
-        setNormalChildNeedsLayout(false);
-        setNeedsPositionedMovementLayout(false);
-    }
-}
-
-inline void RenderObject::setNeedsPositionedMovementLayout(const RenderStyle* oldStyle)
-{
-    bool alreadyNeededLayout = needsPositionedMovementLayout();
-    setNeedsPositionedMovementLayout(true);
-    ASSERT(!isSetNeedsLayoutForbidden());
-    if (!alreadyNeededLayout) {
-        markContainingBlocksForLayout();
-        if (hasLayer()) {
-            if (oldStyle && style()->diffRequiresRepaint(oldStyle))
-                setLayerNeedsFullRepaint();
-            else
-                setLayerNeedsFullRepaintForPositionedMovementLayout();
-        }
-    }
-}
-
-inline void RenderObject::setNeedsSimplifiedNormalFlowLayout()
+inline void RenderObject::setNeedsLayout(MarkingBehavior markParents)
 {
-    bool alreadyNeededLayout = needsSimplifiedNormalFlowLayout();
-    setNeedsSimplifiedNormalFlowLayout(true);
     ASSERT(!isSetNeedsLayoutForbidden());
-    if (!alreadyNeededLayout) {
+    if (m_bitfields.needsLayout())
+        return;
+    m_bitfields.setNeedsLayout(true);
+    if (markParents == MarkContainingBlockChain)
         markContainingBlocksForLayout();
-        if (hasLayer())
-            setLayerNeedsFullRepaint();
-    }
+    if (hasLayer())
+        setLayerNeedsFullRepaint();
 }
 
 inline bool RenderObject::preservesNewline() const
index f3ebeae..c85b5cf 100644 (file)
@@ -96,7 +96,7 @@ void RenderReplaced::layout()
     invalidateBackgroundObscurationStatus();
 
     repainter.repaintAfterLayout();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderReplaced::intrinsicSizeChanged()
index 7330d4e..8757e6b 100644 (file)
@@ -60,7 +60,7 @@ void RenderReplica::layout()
     StackStats::LayoutCheckPoint layoutCheckPoint;
     setFrameRect(parentBox()->borderBoxRect());
     updateLayerTransform();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderReplica::computePreferredLogicalWidths()
index e101a4e..5231e90 100644 (file)
@@ -225,7 +225,7 @@ RenderObject* RenderRubyRun::layoutSpecialExcludedChild(bool relayoutChildren)
     if (!rt)
         return 0;
     if (relayoutChildren)
-        rt->setChildNeedsLayout(true, MarkOnlyThis);
+        rt->setChildNeedsLayout(MarkOnlyThis);
     rt->layoutIfNeeded();
     return rt;
 }
index f614cc7..885d2c2 100644 (file)
@@ -190,7 +190,7 @@ void RenderScrollbar::updateScrollbarParts(bool destroy)
     if (newThickness != oldThickness) {
         setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThickness, isHorizontal ? newThickness : height())));
         if (RenderBox* box = owningRenderer())
-            box->setChildNeedsLayout(true);
+            box->setChildNeedsLayout();
     }
 }
 
index 02b427b..6e313fe 100644 (file)
@@ -63,7 +63,7 @@ void RenderScrollbarPart::layout()
     else
         layoutVerticalPart();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderScrollbarPart::layoutHorizontalPart()
index 74f85bc..440b6f2 100644 (file)
@@ -414,7 +414,7 @@ void RenderTable::layout()
 
     if (logicalWidth() != oldLogicalWidth) {
         for (unsigned i = 0; i < m_captions.size(); i++)
-            m_captions[i]->setNeedsLayout(true, MarkOnlyThis);
+            m_captions[i]->setNeedsLayout(MarkOnlyThis);
     }
     // FIXME: The optimisation below doesn't work since the internal table
     // layout could have changed.  we need to add a flag to the table
@@ -434,7 +434,7 @@ void RenderTable::layout()
         if (child->isTableSection()) {
             RenderTableSection* section = toRenderTableSection(child);
             if (m_columnLogicalWidthChanged)
-                section->setChildNeedsLayout(true, MarkOnlyThis);
+                section->setChildNeedsLayout(MarkOnlyThis);
             section->layoutIfNeeded();
             totalSectionLogicalHeight += section->calcRowLogicalHeight();
             if (collapsing)
@@ -556,7 +556,7 @@ void RenderTable::layout()
     }
 
     m_columnLogicalWidthChanged = false;
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 // Collect all the unique border values that we want to paint in a sorted list.
index bde9aa0..a976fb4 100644 (file)
@@ -221,7 +221,7 @@ public:
         if (documentBeingDestroyed())
             return;
         m_needsSectionRecalc = true;
-        setNeedsLayout(true);
+        setNeedsLayout();
     }
 
     RenderTableSection* sectionAbove(const RenderTableSection*, SkipEmptySectionsValue = DoNotSkipEmptySections) const;
index 209cc10..ee2530f 100644 (file)
@@ -218,7 +218,7 @@ void RenderTableCell::computeIntrinsicPadding(int rowHeight)
     // FIXME: Changing an intrinsic padding shouldn't trigger a relayout as it only shifts the cell inside the row but
     // doesn't change the logical height.
     if (intrinsicPaddingBefore != oldIntrinsicPaddingBefore || intrinsicPaddingAfter != oldIntrinsicPaddingAfter)
-        setNeedsLayout(true, MarkOnlyThis);
+        setNeedsLayout(MarkOnlyThis);
 }
 
 void RenderTableCell::updateLogicalWidth()
@@ -230,8 +230,8 @@ void RenderTableCell::setCellLogicalWidth(int tableLayoutLogicalWidth)
     if (tableLayoutLogicalWidth == logicalWidth())
         return;
 
-    setNeedsLayout(true, MarkOnlyThis);
-    row()->setChildNeedsLayout(true, MarkOnlyThis);
+    setNeedsLayout(MarkOnlyThis);
+    row()->setChildNeedsLayout(MarkOnlyThis);
 
     if (!table()->selfNeedsLayout() && checkForRepaintDuringLayout())
         repaint();
@@ -255,7 +255,7 @@ void RenderTableCell::layout()
     if (isBaselineAligned() && section()->rowBaseline(rowIndex()) && cellBaselinePosition() > section()->rowBaseline(rowIndex())) {
         int newIntrinsicPaddingBefore = max<LayoutUnit>(0, intrinsicPaddingBefore() - max<LayoutUnit>(0, cellBaselinePosition() - oldCellBaseline));
         setIntrinsicPaddingBefore(newIntrinsicPaddingBefore);
-        setNeedsLayout(true, MarkOnlyThis);
+        setNeedsLayout(MarkOnlyThis);
         layoutBlock(cellWidthChanged());
     }
 
index 318b9e4..e4d66da 100644 (file)
@@ -82,7 +82,7 @@ void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* old
             // This only happens when borders are collapsed, since they end up affecting the border sides of the cell
             // itself.
             for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell())
-                cell->setChildNeedsLayout(true, MarkOnlyThis);
+                cell->setChildNeedsLayout(MarkOnlyThis);
         }
     }
 }
@@ -163,7 +163,7 @@ void RenderTableRow::layout()
                 
     for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) {
         if (!cell->needsLayout() && paginated && view().layoutState()->pageLogicalHeight() && view().layoutState()->pageLogicalOffset(cell, cell->logicalTop()) != cell->pageLogicalOffset())
-            cell->setChildNeedsLayout(true, MarkOnlyThis);
+            cell->setChildNeedsLayout(MarkOnlyThis);
 
         if (cell->needsLayout()) {
             cell->computeAndSetBlockDirectionMargins(table());
@@ -183,7 +183,7 @@ void RenderTableRow::layout()
 
     statePusher.pop();
     // RenderTableSection::layoutRows will set our logical height and width later, so it calls updateLayerTransform().
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 LayoutRect RenderTableRow::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
index 1bdac41..7297d82 100644 (file)
@@ -326,7 +326,7 @@ int RenderTableSection::calcRowLogicalHeight()
                     }
                     cell->clearIntrinsicPadding();
                     cell->clearOverrideSize();
-                    cell->setChildNeedsLayout(true, MarkOnlyThis);
+                    cell->setChildNeedsLayout(MarkOnlyThis);
                     cell->layoutIfNeeded();
                 }
 
@@ -406,7 +406,7 @@ void RenderTableSection::layout()
     }
 
     statePusher.pop();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderTableSection::distributeExtraLogicalHeightToPercentRows(int& extraLogicalHeight, int totalPercent)
@@ -566,7 +566,7 @@ void RenderTableSection::layoutRows()
                 if (!o->isText() && o->style()->logicalHeight().isPercent() && (flexAllChildren || ((o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow())) && !o->isTextControl()))) {
                     // Tables with no sections do not flex.
                     if (!o->isTable() || toRenderTable(o)->hasSections()) {
-                        o->setNeedsLayout(true, MarkOnlyThis);
+                        o->setNeedsLayout(MarkOnlyThis);
                         cellChildrenFlex = true;
                     }
                 }
@@ -582,7 +582,7 @@ void RenderTableSection::layoutRows()
                     while (box != cell) {
                         if (box->normalChildNeedsLayout())
                             break;
-                        box->setChildNeedsLayout(true, MarkOnlyThis);
+                        box->setChildNeedsLayout(MarkOnlyThis);
                         box = box->containingBlock();
                         ASSERT(box);
                         if (!box)
@@ -593,7 +593,7 @@ void RenderTableSection::layoutRows()
             }
 
             if (cellChildrenFlex) {
-                cell->setChildNeedsLayout(true, MarkOnlyThis);
+                cell->setChildNeedsLayout(MarkOnlyThis);
                 // Alignment within a cell is based off the calculated
                 // height, which becomes irrelevant once the cell has
                 // been resized based off its percentage.
@@ -615,7 +615,7 @@ void RenderTableSection::layoutRows()
             setLogicalPositionForCell(cell, c);
 
             if (!cell->needsLayout() && view().layoutState()->pageLogicalHeight() && view().layoutState()->pageLogicalOffset(cell, cell->logicalTop()) != cell->pageLogicalOffset())
-                cell->setChildNeedsLayout(true, MarkOnlyThis);
+                cell->setChildNeedsLayout(MarkOnlyThis);
 
             cell->layoutIfNeeded();
 
@@ -1238,7 +1238,7 @@ void RenderTableSection::recalcCells()
     }
 
     m_grid.shrinkToFit();
-    setNeedsLayout(true);
+    setNeedsLayout();
 }
 
 // FIXME: This function could be made O(1) in certain cases (like for the non-most-constrainive cells' case).
index bce9097..4b879c5 100644 (file)
@@ -291,14 +291,14 @@ void RenderTextControl::addFocusRingRects(Vector<IntRect>& rects, const LayoutPo
 RenderObject* RenderTextControl::layoutSpecialExcludedChild(bool relayoutChildren)
 {
     HTMLElement* placeholder = textFormControlElement().placeholderElement();
-    RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() : 0;
+    RenderElement* placeholderRenderer = placeholder ? placeholder->renderer() : 0;
     if (!placeholderRenderer)
         return 0;
     if (relayoutChildren) {
         // The markParents arguments should be false because this function is
         // called from layout() of the parent and the placeholder layout doesn't
         // affect the parent layout.
-        placeholderRenderer->setChildNeedsLayout(true, MarkOnlyThis);
+        placeholderRenderer->setChildNeedsLayout(MarkOnlyThis);
     }
     return placeholderRenderer;
 }
index faf915d..1bddd31 100644 (file)
@@ -102,7 +102,7 @@ static void setNeedsLayoutOnAncestors(RenderObject* start, RenderObject* ancesto
     ASSERT(start != ancestor);
     for (RenderObject* renderer = start; renderer != ancestor; renderer = renderer->parent()) {
         ASSERT(renderer);
-        renderer->setNeedsLayout(true, MarkOnlyThis);
+        renderer->setNeedsLayout(MarkOnlyThis);
     }
 }
 
@@ -144,15 +144,15 @@ void RenderTextControlSingleLine::layout()
     LayoutUnit logicalHeightLimit = computeLogicalHeightLimit();
     if (innerTextRenderer && innerTextRenderer->logicalHeight() > logicalHeightLimit) {
         if (desiredLogicalHeight != innerTextRenderer->logicalHeight())
-            setNeedsLayout(true, MarkOnlyThis);
+            setNeedsLayout(MarkOnlyThis);
 
         m_desiredInnerTextLogicalHeight = desiredLogicalHeight;
 
         innerTextRenderer->style()->setLogicalHeight(Length(desiredLogicalHeight, Fixed));
-        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);
+        innerTextRenderer->setNeedsLayout(MarkOnlyThis);
         if (innerBlockRenderer) {
             innerBlockRenderer->style()->setLogicalHeight(Length(desiredLogicalHeight, Fixed));
-            innerBlockRenderer->setNeedsLayout(true, MarkOnlyThis);
+            innerBlockRenderer->setNeedsLayout(MarkOnlyThis);
         }
     }
     // The container might be taller because of decoration elements.
@@ -161,10 +161,10 @@ void RenderTextControlSingleLine::layout()
         LayoutUnit containerLogicalHeight = containerRenderer->logicalHeight();
         if (containerLogicalHeight > logicalHeightLimit) {
             containerRenderer->style()->setLogicalHeight(Length(logicalHeightLimit, Fixed));
-            setNeedsLayout(true, MarkOnlyThis);
+            setNeedsLayout(MarkOnlyThis);
         } else if (containerRenderer->logicalHeight() < contentLogicalHeight()) {
             containerRenderer->style()->setLogicalHeight(Length(contentLogicalHeight(), Fixed));
-            setNeedsLayout(true, MarkOnlyThis);
+            setNeedsLayout(MarkOnlyThis);
         } else
             containerRenderer->style()->setLogicalHeight(Length(containerLogicalHeight, Fixed));
     }
@@ -263,7 +263,7 @@ void RenderTextControlSingleLine::styleDidChange(StyleDifference diff, const Ren
     }
     RenderObject* innerTextRenderer = innerTextElement()->renderer();
     if (innerTextRenderer && diff == StyleDifferenceLayout)
-        innerTextRenderer->setNeedsLayout(true, MarkContainingBlockChain);
+        innerTextRenderer->setNeedsLayout(MarkContainingBlockChain);
     if (HTMLElement* placeholder = inputElement().placeholderElement())
         placeholder->setInlineStyleProperty(CSSPropertyTextOverflow, textShouldBeTruncated() ? CSSValueEllipsis : CSSValueClip);
     setHasOverflowClip(false);
index e535c2f..90fc65e 100644 (file)
@@ -92,7 +92,7 @@ void RenderVideo::updateIntrinsicSize()
 
     setIntrinsicSize(size);
     setPreferredLogicalWidthsDirty(true);
-    setNeedsLayout(true);
+    setNeedsLayout();
 }
     
 LayoutSize RenderVideo::calculateIntrinsicSize()
index 4440a8c..6661d34 100644 (file)
@@ -302,20 +302,24 @@ void RenderView::layout()
     // Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
     bool relayoutChildren = !shouldUsePrintingLayout() && (width() != viewWidth() || height() != viewHeight());
     if (relayoutChildren) {
-        setChildNeedsLayout(true, MarkOnlyThis);
+        setChildNeedsLayout(MarkOnlyThis);
         for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
-            if ((child->isBox() && (toRenderBox(child)->hasRelativeLogicalHeight() || toRenderBox(child)->hasViewportPercentageLogicalHeight()))
-                    || child->style()->logicalHeight().isPercent()
-                    || child->style()->logicalMinHeight().isPercent()
-                    || child->style()->logicalMaxHeight().isPercent()
-                    || child->style()->logicalHeight().isViewportPercentage()
-                    || child->style()->logicalMinHeight().isViewportPercentage()
-                    || child->style()->logicalMaxHeight().isViewportPercentage()
+            if (!child->isBox())
+                continue;
+            RenderBox& box = toRenderBox(*child);
+            if (box.hasRelativeLogicalHeight()
+                || box.hasViewportPercentageLogicalHeight()
+                || box.style()->logicalHeight().isPercent()
+                || box.style()->logicalMinHeight().isPercent()
+                || box.style()->logicalMaxHeight().isPercent()
+                || box.style()->logicalHeight().isViewportPercentage()
+                || box.style()->logicalMinHeight().isViewportPercentage()
+                || box.style()->logicalMaxHeight().isViewportPercentage()
 #if ENABLE(SVG)
-                    || child->isSVGRoot()
+                || box.isSVGRoot()
 #endif
                 )
-                child->setChildNeedsLayout(true, MarkOnlyThis);
+                box.setChildNeedsLayout(MarkOnlyThis);
         }
     }
 
@@ -340,7 +344,7 @@ void RenderView::layout()
     checkLayoutState(state);
 #endif
     m_layoutState = 0;
-    setNeedsLayout(false);
+    clearNeedsLayout();
     
     if (isSeamlessAncestorInFlowThread)
         flowThreadController().setCurrentRenderFlowThread(0);
index 6168d52..90584b9 100644 (file)
@@ -217,7 +217,7 @@ void RenderWidget::layout()
     StackStats::LayoutCheckPoint layoutCheckPoint;
     ASSERT(needsLayout());
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderWidget::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
index 3c56c3d..144d074 100644 (file)
@@ -82,7 +82,7 @@ void RenderMathMLBlock::computeChildrenPreferredLogicalHeights()
     FragmentationDisabler fragmentationDisabler(this);
 
     // Ensure a full repaint will happen after layout finishes.
-    setNeedsLayout(true, MarkOnlyThis);
+    setNeedsLayout(MarkOnlyThis);
 
     bool hadLayoutState = view().layoutState();
     if (!hadLayoutState)
@@ -100,7 +100,7 @@ void RenderMathMLBlock::computeChildrenPreferredLogicalHeights()
             
             // Because our width changed, |child| may need layout.
             if (child->maxPreferredLogicalWidth() > oldAvailableLogicalWidth)
-                child->setNeedsLayout(true, MarkOnlyThis);
+                child->setNeedsLayout(MarkOnlyThis);
             
             RenderMathMLBlock* childMathMLBlock = child->isRenderMathMLBlock() ? toRenderMathMLBlock(child) : 0;
             if (childMathMLBlock && !childMathMLBlock->isPreferredLogicalHeightDirty())
index cbecaba..7861fbf 100644 (file)
@@ -349,8 +349,8 @@ void RenderMathMLScripts::layout()
     if (!needsSecondLayout)
         return;
 
-    setNeedsLayout(true, MarkOnlyThis);
-    m_baseWrapper->setChildNeedsLayout(true, MarkOnlyThis);
+    setNeedsLayout(MarkOnlyThis);
+    m_baseWrapper->setChildNeedsLayout(MarkOnlyThis);
 
     RenderMathMLBlock::layout();
 }
index 8bea90f..96cbed6 100644 (file)
@@ -86,7 +86,7 @@ void RenderSVGContainer::layout()
     }
 
     repainter.repaintAfterLayout();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderSVGContainer::addChild(RenderObject* child, RenderObject* beforeChild)
index d13cc65..aa02d09 100644 (file)
@@ -66,7 +66,7 @@ void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderSty
 void RenderSVGGradientStop::layout()
 {
     StackStats::LayoutCheckPoint layoutCheckPoint;
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 SVGGradientElement* RenderSVGGradientStop::gradientElement() const
index 57a7ba7..aa5205a 100644 (file)
@@ -38,7 +38,7 @@ void RenderSVGHiddenContainer::layout()
     StackStats::LayoutCheckPoint layoutCheckPoint;
     ASSERT(needsLayout());
     SVGRenderSupport::layoutChildren(this, selfNeedsLayout()); 
-    setNeedsLayout(false);    
+    clearNeedsLayout();    
 }
 
 void RenderSVGHiddenContainer::paint(PaintInfo&, const LayoutPoint&)
index 51bfdff..8c9f339 100644 (file)
@@ -115,7 +115,7 @@ void RenderSVGImage::layout()
         RenderSVGModelObject::setNeedsBoundariesUpdate();
 
     repainter.repaintAfterLayout();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
index a37cfdb..4e54d40 100644 (file)
@@ -195,7 +195,7 @@ void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject*
     ASSERT(object->node());
 
     if (needsLayout && !object->documentBeingDestroyed())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 
     removeFromCacheAndInvalidateDependencies(object, needsLayout);
 
index 3c94d97..ed72723 100644 (file)
@@ -193,7 +193,7 @@ void RenderSVGResourceContainer::registerResource()
         if (!renderer)
             continue;
         SVGResourcesCache::clientStyleChanged(renderer, StyleDifferenceLayout, renderer->style());
-        renderer->setNeedsLayout(true);
+        renderer->setNeedsLayout();
     }
 }
 
index 9de20a2..61fdcb2 100644 (file)
@@ -236,7 +236,7 @@ void RenderSVGRoot::layout()
 
     repainter.repaintAfterLayout();
 
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 void RenderSVGRoot::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
index 9cd55fa..8cb9a34 100644 (file)
@@ -172,7 +172,7 @@ void RenderSVGShape::layout()
         RenderSVGModelObject::setNeedsBoundariesUpdate();
 
     repainter.repaintAfterLayout();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 Path* RenderSVGShape::nonScalingStrokePath(const Path* path, const AffineTransform& strokeTransform) const
index 80e2bd4..6e500c7 100644 (file)
@@ -438,7 +438,7 @@ void RenderSVGText::layout()
         RenderSVGBlock::setNeedsBoundariesUpdate();
 
     repainter.repaintAfterLayout();
-    setNeedsLayout(false);
+    clearNeedsLayout();
 }
 
 RootInlineBox* RenderSVGText::createRootInlineBox() 
index 50af874..34c7b58 100644 (file)
@@ -269,7 +269,7 @@ void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
         }
 
         if (needsLayout)
-            child->setNeedsLayout(true, MarkOnlyThis);
+            child->setNeedsLayout(MarkOnlyThis);
 
         if (child->needsLayout()) {
             child->layout();
index d8d3680..f8f9504 100644 (file)
@@ -100,7 +100,7 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName)
     SVGElementInstance::InvalidationGuard invalidationGuard(this);
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGClipPathElement::childrenChanged(const ChildChange& change)
@@ -111,7 +111,7 @@ void SVGClipPathElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGClipPathElement::createRenderer(RenderArena& arena, RenderStyle&)
index 85db4ca..3dd0ba5 100644 (file)
@@ -100,7 +100,7 @@ void SVGFilterElement::setFilterRes(unsigned filterResX, unsigned filterResY)
     setFilterResYBaseValue(filterResY);
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 bool SVGFilterElement::isSupportedAttribute(const QualifiedName& attrName)
@@ -174,7 +174,7 @@ void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
         updateRelativeLengthsInformation();
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGFilterElement::childrenChanged(const ChildChange& change)
@@ -185,7 +185,7 @@ void SVGFilterElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGFilterElement::createRenderer(RenderArena& arena, RenderStyle&)
index f4943d3..10f3ac1 100644 (file)
@@ -123,7 +123,7 @@ void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
     SVGElementInstance::InvalidationGuard invalidationGuard(this);
     
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
     
 void SVGGradientElement::childrenChanged(const ChildChange& change)
@@ -134,7 +134,7 @@ void SVGGradientElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 Vector<Gradient::ColorStop> SVGGradientElement::buildStops()
index fd94d60..b54cd4d 100644 (file)
@@ -115,7 +115,7 @@ void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName
     updateRelativeLengthsInformation();
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGLinearGradientElement::createRenderer(RenderArena& arena, RenderStyle&)
index 2a8f24d..9c6b376 100644 (file)
@@ -176,7 +176,7 @@ void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName)
         updateRelativeLengthsInformation();
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGMarkerElement::childrenChanged(const ChildChange& change)
@@ -187,7 +187,7 @@ void SVGMarkerElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGMarkerElement::setOrientToAuto()
index 1b62363..90eb6d3 100644 (file)
@@ -143,7 +143,7 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName)
         updateRelativeLengthsInformation();
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGMaskElement::childrenChanged(const ChildChange& change)
@@ -154,7 +154,7 @@ void SVGMaskElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGMaskElement::createRenderer(RenderArena& arena, RenderStyle&)
index 653ca34..3f40a97 100644 (file)
@@ -168,7 +168,7 @@ void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName)
         updateRelativeLengthsInformation();
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 void SVGPatternElement::childrenChanged(const ChildChange& change)
@@ -179,7 +179,7 @@ void SVGPatternElement::childrenChanged(const ChildChange& change)
         return;
 
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGPatternElement::createRenderer(RenderArena& arena, RenderStyle&)
index c42d374..2b6a345 100644 (file)
@@ -127,7 +127,7 @@ void SVGRadialGradientElement::svgAttributeChanged(const QualifiedName& attrName
     updateRelativeLengthsInformation();
         
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 }
 
 RenderElement* SVGRadialGradientElement::createRenderer(RenderArena& arena, RenderStyle&)
index 87df5de..69d59db 100644 (file)
@@ -221,7 +221,7 @@ void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation)
 void SVGSVGElement::updateCurrentTranslate()
 {
     if (RenderObject* object = renderer())
-        object->setNeedsLayout(true);
+        object->setNeedsLayout();
 
     if (parentNode() == &document() && document().renderView())
         document().renderView()->repaint();