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

    r156639 r156816  
    620620}
    621621
     622void RenderObject::clearNeedsLayout()
     623{
     624    m_bitfields.setNeedsLayout(false);
     625    setEverHadLayout(true);
     626    setPosChildNeedsLayoutBit(false);
     627    setNeedsSimplifiedNormalFlowLayoutBit(false);
     628    setNormalChildNeedsLayoutBit(false);
     629    setNeedsPositionedMovementLayoutBit(false);
     630    if (isRenderElement())
     631        toRenderElement(this)->setAncestorLineBoxDirty(false);
     632#ifndef NDEBUG
     633    checkBlockPositionedObjectsNeedLayout();
     634#endif
     635}
     636
    622637void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderObject* newRoot)
    623638{
     
    641656        if (!container && !object->isRenderView())
    642657            return;
    643         if (!last->isText() && last->style()->hasOutOfFlowPosition()) {
     658        if (last->style()->hasOutOfFlowPosition()) {
    644659            bool willSkipRelativelyPositionedInlines = !object->isRenderBlock() || object->isAnonymousBlock();
    645660            // Skip relatively positioned inlines and anonymous blocks to get to the enclosing RenderBlock.
     
    650665            if (willSkipRelativelyPositionedInlines)
    651666                container = object->container();
    652             object->setPosChildNeedsLayout(true);
     667            object->setPosChildNeedsLayoutBit(true);
    653668            simplifiedNormalFlowLayout = true;
    654669            ASSERT(!object->isSetNeedsLayoutForbidden());
     
    656671            if (object->needsSimplifiedNormalFlowLayout())
    657672                return;
    658             object->setNeedsSimplifiedNormalFlowLayout(true);
     673            object->setNeedsSimplifiedNormalFlowLayoutBit(true);
    659674            ASSERT(!object->isSetNeedsLayoutForbidden());
    660675        } else {
    661676            if (object->normalChildNeedsLayout())
    662677                return;
    663             object->setNormalChildNeedsLayout(true);
     678            object->setNormalChildNeedsLayoutBit(true);
    664679            ASSERT(!object->isSetNeedsLayoutForbidden());
    665680        }
     
    22102225        child = child->nextSibling();
    22112226    }
    2212     setNeedsLayout(false);
     2227    clearNeedsLayout();
    22132228}
    22142229
Note: See TracChangeset for help on using the changeset viewer.