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/RenderElement.h

    r156738 r156816  
    8383    void setAncestorLineBoxDirty(bool f = true);
    8484
     85    void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain);
     86    void clearChildNeedsLayout();
     87    void setNeedsPositionedMovementLayout(const RenderStyle* oldStyle);
     88    void setNeedsSimplifiedNormalFlowLayout();
     89
    8590    // 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.
    8691    RenderElement* rendererForRootBackground();
     
    170175    m_ancestorLineBoxDirty = f;
    171176    if (m_ancestorLineBoxDirty)
    172         setNeedsLayout(true);
     177        setNeedsLayout();
     178}
     179
     180inline void RenderElement::setChildNeedsLayout(MarkingBehavior markParents)
     181{
     182    ASSERT(!isSetNeedsLayoutForbidden());
     183    if (normalChildNeedsLayout())
     184        return;
     185    setNormalChildNeedsLayoutBit(true);
     186    if (markParents == MarkContainingBlockChain)
     187        markContainingBlocksForLayout();
    173188}
    174189
     
    285300}
    286301
    287 inline void RenderObject::setNeedsLayout(bool needsLayout, MarkingBehavior markParents)
    288 {
    289     bool alreadyNeededLayout = m_bitfields.needsLayout();
    290     m_bitfields.setNeedsLayout(needsLayout);
    291     if (needsLayout) {
    292         ASSERT(!isSetNeedsLayoutForbidden());
    293         if (!alreadyNeededLayout) {
    294             if (markParents == MarkContainingBlockChain)
    295                 markContainingBlocksForLayout();
    296             if (hasLayer())
    297                 setLayerNeedsFullRepaint();
    298         }
    299     } else {
    300         setEverHadLayout(true);
    301         setPosChildNeedsLayout(false);
    302         setNeedsSimplifiedNormalFlowLayout(false);
    303         setNormalChildNeedsLayout(false);
    304         setNeedsPositionedMovementLayout(false);
    305         if (isRenderElement())
    306             toRenderElement(this)->setAncestorLineBoxDirty(false);
    307 #ifndef NDEBUG
    308         checkBlockPositionedObjectsNeedLayout();
    309 #endif
    310     }
    311 }
    312 
    313302inline RenderElement* ContainerNode::renderer() const
    314303{
Note: See TracChangeset for help on using the changeset viewer.