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

    r156779 r156816  
    559559    setPreferredLogicalWidthsDirty(true);
    560560    if (!normalChildNeedsLayout())
    561         setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.
     561        setChildNeedsLayout(); // We may supply the static position for an absolute positioned child.
    562562
    563563    if (AXObjectCache* cache = document().axObjectCache())
     
    996996}
    997997
     998void RenderElement::setNeedsPositionedMovementLayout(const RenderStyle* oldStyle)
     999{
     1000    ASSERT(!isSetNeedsLayoutForbidden());
     1001    if (needsPositionedMovementLayout())
     1002        return;
     1003    setNeedsPositionedMovementLayoutBit(true);
     1004    markContainingBlocksForLayout();
     1005    if (!hasLayer()) {
     1006        if (oldStyle && style()->diffRequiresRepaint(oldStyle))
     1007            setLayerNeedsFullRepaint();
     1008        else
     1009            setLayerNeedsFullRepaintForPositionedMovementLayout();
     1010    }
     1011}
     1012
     1013void RenderElement::clearChildNeedsLayout()
     1014{
     1015    setNormalChildNeedsLayoutBit(false);
     1016    setPosChildNeedsLayoutBit(false);
     1017    setNeedsSimplifiedNormalFlowLayoutBit(false);
     1018    setNormalChildNeedsLayoutBit(false);
     1019    setNeedsPositionedMovementLayoutBit(false);
     1020}
     1021
     1022void RenderElement::setNeedsSimplifiedNormalFlowLayout()
     1023{
     1024    ASSERT(!isSetNeedsLayoutForbidden());
     1025    if (needsSimplifiedNormalFlowLayout())
     1026        return;
     1027    setNeedsSimplifiedNormalFlowLayoutBit(true);
     1028    markContainingBlocksForLayout();
     1029    if (hasLayer())
     1030        setLayerNeedsFullRepaint();
     1031}
     1032
    9981033RenderElement* RenderElement::rendererForRootBackground()
    9991034{
Note: See TracChangeset for help on using the changeset viewer.