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/RenderBox.cpp

    r156767 r156816  
    284284                repaint();
    285285            else if (newStyle->hasOutOfFlowPosition())
    286                 parent()->setChildNeedsLayout(true);
     286                parent()->setChildNeedsLayout();
    287287            if (isFloating() && !isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition())
    288288                removeFloatingOrPositionedChildFromBlockLists();
     
    312312        if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition(isHorizontalWritingMode()) && oldStyle->marginBefore() != newStyle->marginBefore()
    313313            && parent() && !parent()->normalChildNeedsLayout())
    314             parent()->setChildNeedsLayout(true);
     314            parent()->setChildNeedsLayout();
    315315    }
    316316
     
    451451    RenderObject* child = firstChild();
    452452    if (!child) {
    453         setNeedsLayout(false);
     453        clearNeedsLayout();
    454454        return;
    455455    }
     
    463463    statePusher.pop();
    464464    invalidateBackgroundObscurationStatus();
    465     setNeedsLayout(false);
     465    clearNeedsLayout();
    466466}
    467467
     
    19631963            rootBox.block().setStaticInlinePositionForChild(this, rootBox.lineTopWithLeading(), roundedLayoutUnit(box->logicalLeft()));
    19641964            if (style()->hasStaticInlinePosition(box->isHorizontal()))
    1965                 setChildNeedsLayout(true, MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
     1965                setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
    19661966        } else {
    19671967            // Our object was a block originally, so we make our normal flow position be
     
    19711971            layer()->setStaticBlockPosition(box->logicalTop());
    19721972            if (style()->hasStaticBlockPosition(box->isHorizontal()))
    1973                 setChildNeedsLayout(true, MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
     1973                setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
    19741974        }
    19751975
Note: See TracChangeset for help on using the changeset viewer.