Ignore:
Timestamp:
Oct 2, 2013, 7:26:52 PM (12 years ago)
Author:
Antti Koivisto
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r156622 r156816  
    303303    bool relayoutChildren = !shouldUsePrintingLayout() && (width() != viewWidth() || height() != viewHeight());
    304304    if (relayoutChildren) {
    305         setChildNeedsLayout(true, MarkOnlyThis);
     305        setChildNeedsLayout(MarkOnlyThis);
    306306        for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
    307             if ((child->isBox() && (toRenderBox(child)->hasRelativeLogicalHeight() || toRenderBox(child)->hasViewportPercentageLogicalHeight()))
    308                     || child->style()->logicalHeight().isPercent()
    309                     || child->style()->logicalMinHeight().isPercent()
    310                     || child->style()->logicalMaxHeight().isPercent()
    311                     || child->style()->logicalHeight().isViewportPercentage()
    312                     || child->style()->logicalMinHeight().isViewportPercentage()
    313                     || child->style()->logicalMaxHeight().isViewportPercentage()
     307            if (!child->isBox())
     308                continue;
     309            RenderBox& box = toRenderBox(*child);
     310            if (box.hasRelativeLogicalHeight()
     311                || box.hasViewportPercentageLogicalHeight()
     312                || box.style()->logicalHeight().isPercent()
     313                || box.style()->logicalMinHeight().isPercent()
     314                || box.style()->logicalMaxHeight().isPercent()
     315                || box.style()->logicalHeight().isViewportPercentage()
     316                || box.style()->logicalMinHeight().isViewportPercentage()
     317                || box.style()->logicalMaxHeight().isViewportPercentage()
    314318#if ENABLE(SVG)
    315                     || child->isSVGRoot()
     319                || box.isSVGRoot()
    316320#endif
    317321                )
    318                 child->setChildNeedsLayout(true, MarkOnlyThis);
     322                box.setChildNeedsLayout(MarkOnlyThis);
    319323        }
    320324    }
     
    341345#endif
    342346    m_layoutState = 0;
    343     setNeedsLayout(false);
     347    clearNeedsLayout();
    344348   
    345349    if (isSeamlessAncestorInFlowThread)
Note: See TracChangeset for help on using the changeset viewer.