Changeset 156278 in webkit


Ignore:
Timestamp:
Sep 23, 2013, 10:43:04 AM (11 years ago)
Author:
Antti Koivisto
Message:

Remove RenderObjectChildList
https://bugs.webkit.org/show_bug.cgi?id=121771

Reviewed by Darin Adler.

Most RenderElement subclasses have m_children member (>90% of instances on typical page). It is not worth optimising
for memory for the few cases that don't (RenderImage, RenderLineBreak mostly) in expense of performance.

This patch moves child handling to RenderElement. This gets rid of virtual children() calls and simplifies the code.

Location:
trunk/Source/WebCore
Files:
2 deleted
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r156267 r156278  
    21792179    rendering/RenderNamedFlowThread.cpp
    21802180    rendering/RenderObject.cpp
    2181     rendering/RenderObjectChildList.cpp
    21822181    rendering/RenderProgress.cpp
    21832182    rendering/RenderQuote.cpp
  • trunk/Source/WebCore/ChangeLog

    r156274 r156278  
     12013-09-23  Antti Koivisto  <antti@apple.com>
     2
     3        Remove RenderObjectChildList
     4        https://bugs.webkit.org/show_bug.cgi?id=121771
     5
     6        Reviewed by Darin Adler.
     7
     8        Most RenderElement subclasses have m_children member (>90% of instances on typical page). It is not worth optimising
     9        for memory for the few cases that don't (RenderImage, RenderLineBreak mostly) in expense of performance.
     10       
     11        This patch moves child handling to RenderElement. This gets rid of virtual children() calls and simplifies the code.
     12
    1132013-09-23  Andreas Kling  <akling@apple.com>
    214
  • trunk/Source/WebCore/GNUmakefile.list.am

    r156262 r156278  
    45054505        Source/WebCore/rendering/RenderNamedFlowThread.cpp \
    45064506        Source/WebCore/rendering/RenderNamedFlowThread.h \
    4507         Source/WebCore/rendering/RenderObjectChildList.cpp \
    4508         Source/WebCore/rendering/RenderObjectChildList.h \
    45094507        Source/WebCore/rendering/RenderObject.cpp \
    45104508        Source/WebCore/rendering/RenderObject.h \
  • trunk/Source/WebCore/Target.pri

    r156262 r156278  
    11951195    rendering/RenderNamedFlowThread.cpp \
    11961196    rendering/RenderObject.cpp \
    1197     rendering/RenderObjectChildList.cpp \
    11981197    rendering/RenderProgress.cpp \
    11991198    rendering/RenderQuote.cpp \
     
    24622461    rendering/RenderMeter.h \
    24632462    rendering/RenderMultiColumnBlock.h \
    2464     rendering/RenderObjectChildList.h \
    24652463    rendering/RenderObject.h \
    24662464    rendering/RenderProgress.h \
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r156262 r156278  
    1024010240    <ClCompile Include="..\rendering\RenderNamedFlowThread.cpp" />
    1024110241    <ClCompile Include="..\rendering\RenderObject.cpp">
    10242       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    10243       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    10244       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
    10245       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
    10246       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
    10247       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
    10248       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
    10249       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    10250       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
    10251       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
    10252       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
    10253       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
    10254     </ClCompile>
    10255     <ClCompile Include="..\rendering\RenderObjectChildList.cpp">
    1025610242      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
    1025710243      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     
    2000619992    <ClInclude Include="..\rendering\RenderNamedFlowThread.h" />
    2000719993    <ClInclude Include="..\rendering\RenderObject.h" />
    20008     <ClInclude Include="..\rendering\RenderObjectChildList.h" />
    2000919994    <ClInclude Include="..\rendering\RenderProgress.h" />
    2001019995    <ClInclude Include="..\rendering\RenderQuote.h" />
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r156262 r156278  
    47694769                BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */; };
    47704770                BC2CBF7B140F1D58003879BE /* JSWebGLContextEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */; };
    4771                 BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47724771                BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */; };
    47734772                BC2ED6BC0C6BD2F000920BFF /* JSAttrCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */; };
     
    48894888                BC60DB490D2A3D1E00B9918F /* JSXPathException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */; };
    48904889                BC60DB4A0D2A3D1E00B9918F /* JSXPathException.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60DB480D2A3D1E00B9918F /* JSXPathException.h */; };
    4891                 BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60EFB60F33A0E700812A93 /* RenderObjectChildList.cpp */; };
    48924890                BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64640711D7F304006455B0 /* DOMStringMap.cpp */; };
    48934891                BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64640811D7F304006455B0 /* DOMStringMap.h */; };
     
    1163211630                BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextEvent.h; sourceTree = "<group>"; };
    1163311631                BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextEvent.cpp; sourceTree = "<group>"; };
    11634                 BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderObjectChildList.h; sourceTree = "<group>"; };
    1163511632                BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; };
    1163611633                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttrCustom.cpp; sourceTree = "<group>"; };
     
    1176111758                BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathException.cpp; sourceTree = "<group>"; };
    1176211759                BC60DB480D2A3D1E00B9918F /* JSXPathException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXPathException.h; sourceTree = "<group>"; };
    11763                 BC60EFB60F33A0E700812A93 /* RenderObjectChildList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderObjectChildList.cpp; sourceTree = "<group>"; };
    1176411760                BC64640711D7F304006455B0 /* DOMStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMStringMap.cpp; sourceTree = "<group>"; };
    1176511761                BC64640811D7F304006455B0 /* DOMStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringMap.h; sourceTree = "<group>"; };
     
    2063220628                                BCEA4840097D93020094C9E4 /* RenderObject.cpp */,
    2063320629                                BCEA4841097D93020094C9E4 /* RenderObject.h */,
    20634                                 BC60EFB60F33A0E700812A93 /* RenderObjectChildList.cpp */,
    20635                                 BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */,
    2063620630                                BCFA930710333193007B25D1 /* RenderOverflow.h */,
    2063720631                                A43BF59A1149292800C643CA /* RenderProgress.cpp */,
     
    2377723771                                BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */,
    2377823772                                BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */,
    23779                                 BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */,
    2378023773                                BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
    2378123774                                A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
     
    2699726990                                1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */,
    2699826991                                BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
    26999                                 BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */,
    2700026992                                A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
    2700126993                                5A574F24131DB93900471B88 /* RenderQuote.cpp in Sources */,
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r156262 r156278  
    5050    RenderTableCell* maxContributor = 0;
    5151
    52     for (RenderObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) {
     52    for (RenderObject* child = m_table->firstChild(); child; child = child->nextSibling()) {
    5353        if (child->isRenderTableCol()){
    5454            // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits
     
    6666                    continue;
    6767
    68                 bool cellHasContent = cell->children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
     68                bool cellHasContent = cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
    6969                if (cellHasContent)
    7070                    columnLayout.emptyCellsOnly = false;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156262 r156278  
    8585struct SameSizeAsRenderBlock : public RenderBox {
    8686    void* pointers[2];
    87     RenderObjectChildList children;
    8887    RenderLineBoxList lineBoxes;
    8988    uint32_t bitfields;
     
    214213    // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
    215214    // properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
    216     children()->destroyLeftoverChildren();
     215    destroyLeftoverChildren();
    217216
    218217    // Destroy our continuation before anything other than anonymous children.
     
    469468        // Create a new block of the correct type.
    470469        RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock();
    471         children()->appendChildNode(this, newBox);
     470        insertChildInternal(newBox, nullptr, NotifyChildren);
    472471        newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0);
    473472        return;
     
    492491    // Create a new anonymous box of the appropriate type.
    493492    RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock();
    494     children()->insertChildNode(this, newBox, newBeforeChild);
     493    insertChildInternal(newBox, newBeforeChild, NotifyChildren);
    495494    newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0);
    496495    return;
     
    609608
    610609    // Now we are at the columns block level. We need to put the clone into the toBlock.
    611     toBlock->children()->appendChildNode(toBlock, cloneBlock);
     610    toBlock->insertChildInternal(cloneBlock, nullptr, NotifyChildren);
    612611
    613612    // Now take all the children after currChild and remove them from the fromBlock
     
    644643    RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
    645644    if (madeNewBeforeBlock)
    646         block->children()->insertChildNode(block, pre, boxFirst);
    647     block->children()->insertChildNode(block, newBlockBox, boxFirst);
    648     block->children()->insertChildNode(block, post, boxFirst);
     645        block->insertChildInternal(pre, boxFirst, NotifyChildren);
     646    block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren);
     647    block->insertChildInternal(post, boxFirst, NotifyChildren);
    649648    block->setChildrenInline(false);
    650649   
     
    696695    RenderObject* boxFirst = block->firstChild();
    697696    if (pre)
    698         block->children()->insertChildNode(block, pre, boxFirst);
    699     block->children()->insertChildNode(block, newBlockBox, boxFirst);
     697        block->insertChildInternal(pre, boxFirst, NotifyChildren);
     698    block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren);
    700699    if (post)
    701         block->children()->insertChildNode(block, post, boxFirst);
     700        block->insertChildInternal(post, boxFirst, NotifyChildren);
    702701    block->setChildrenInline(false);
    703702   
     
    10061005
    10071006        RenderBlock* block = createAnonymousBlock();
    1008         children()->insertChildNode(this, block, inlineRunStart);
     1007        insertChildInternal(block, inlineRunStart, NotifyChildren);
    10091008        moveChildrenTo(block, inlineRunStart, child);
    10101009    }
     
    10261025        return;
    10271026   
    1028     RenderObject* firstAnChild = child->m_children.firstChild();
    1029     RenderObject* lastAnChild = child->m_children.lastChild();
     1027    RenderObject* firstAnChild = child->firstChild();
     1028    RenderObject* lastAnChild = child->lastChild();
    10301029    if (firstAnChild) {
    10311030        RenderObject* o = firstAnChild;
     
    10411040            child->nextSibling()->setPreviousSibling(lastAnChild);
    10421041           
    1043         if (child == m_children.firstChild())
    1044             m_children.setFirstChild(firstAnChild);
    1045         if (child == m_children.lastChild())
    1046             m_children.setLastChild(lastAnChild);
     1042        if (child == firstChild())
     1043            setFirstChild(firstAnChild);
     1044        if (child == lastChild())
     1045            setLastChild(lastAnChild);
    10471046    } else {
    1048         if (child == m_children.firstChild())
    1049             m_children.setFirstChild(child->nextSibling());
    1050         if (child == m_children.lastChild())
    1051             m_children.setLastChild(child->previousSibling());
     1047        if (child == firstChild())
     1048            setFirstChild(child->nextSibling());
     1049        if (child == lastChild())
     1050            setLastChild(child->previousSibling());
    10521051
    10531052        if (child->previousSibling())
     
    10571056    }
    10581057
    1059     child->children()->setFirstChild(0);
     1058    child->setFirstChild(0);
    10601059    child->m_next = 0;
    10611060
     
    10951094}
    10961095
    1097 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child)
     1096void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child)
    10981097{
    10991098    parent->setNeedsLayoutAndPrefWidthsRecalc();
     
    11031102    RenderFlowThread* childFlowThread = child->flowThreadContainingBlock();
    11041103    CurrentRenderFlowThreadMaintainer flowThreadMaintainer(childFlowThread);
    1105    
    1106     RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(parent, child, child->hasLayer()));
    1107     anonBlock->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
     1104
     1105    parent->removeChildInternal(child, child->hasLayer() ? NotifyChildren : DontNotifyChildren);
     1106    child->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
    11081107    // Delete the now-empty block's lines and nuke it.
    1109     anonBlock->deleteLineBoxTree();
     1108    child->deleteLineBoxTree();
    11101109    if (childFlowThread && childFlowThread->isRenderNamedFlowThread())
    1111         toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo(anonBlock);
    1112     anonBlock->destroy();
     1110        toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo(child);
     1111    child->destroy();
    11131112}
    11141113
     
    11891188            bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer();
    11901189            inlineChildrenBlock->setStyle(newStyle);
    1191             children()->removeChildNode(this, inlineChildrenBlock, inlineChildrenBlockHasLayer);
     1190            removeChildInternal(inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
    11921191           
    11931192            // Now just put the inlineChildrenBlock inside the blockChildrenBlock.
    1194             blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChild() : 0,
    1195                                                             inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer());
     1193            RenderObject* beforeChild = prev == inlineChildrenBlock ? blockChildrenBlock->firstChild() : nullptr;
     1194            blockChildrenBlock->insertChildInternal(inlineChildrenBlock, beforeChild,
     1195                (inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()) ? NotifyChildren : DontNotifyChildren);
    11961196            next->setNeedsLayoutAndPrefWidthsRecalc();
    11971197           
     
    12211221        // box.  We can go ahead and pull the content right back up into our
    12221222        // box.
    1223         collapseAnonymousBoxChild(this, child);
     1223        collapseAnonymousBoxChild(this, toRenderBlock(child));
    12241224    } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && canCollapseAnonymousBlockChild()) {
    12251225        // It's possible that the removal has knocked us down to a single anonymous
     
    58465846        // To prevent removal of single anonymous block in RenderBlock::removeChild and causing
    58475847        // |nextSibling| to go stale, we remove the old first letter using removeChildNode first.
    5848         firstLetterContainer->children()->removeChildNode(firstLetterContainer, firstLetter);
     5848        firstLetterContainer->removeChildInternal(firstLetter, NotifyChildren);
    58495849        firstLetter->destroy();
    58505850        firstLetter = newFirstLetter;
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r156262 r156278  
    105105    static RenderBlock* createAnonymous(Document&);
    106106
    107     RenderObject* firstChild() const { return m_children.firstChild(); }
    108     RenderObject* lastChild() const { return m_children.lastChild(); }
    109 
    110     virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }
    111     virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }
    112 
    113107    bool beingDestroyed() const { return m_beingDestroyed; }
    114108
     
    293287    RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
    294288    RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
    295     static void collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* child);
     289    static void collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child);
    296290
    297291    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE;
     
    572566    virtual bool isRenderBlock() const OVERRIDE FINAL { return true; }
    573567    virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() && isReplaced(); }
     568    virtual bool canHaveChildren() const OVERRIDE { return true; }
    574569
    575570    void makeChildrenNonInline(RenderObject* insertionPoint = 0);
     
    879874    OwnPtr<RenderBlockRareData> m_rareData;
    880875
    881     RenderObjectChildList m_children;
    882876    RenderLineBoxList m_lineBoxes;   // All of the root line boxes created for this block flow.  For example, <div>Hello<br>world.</div> will have two total lines for the <div>.
    883877
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r156262 r156278  
    46454645            // See for example RenderTableCell:clippedOverflowRectForRepaint.
    46464646            markBoxForRelayoutAfterSplit(parentBox);
    4647             parentBox->children()->insertChildNode(parentBox, postBox, boxToSplit->nextSibling());
     4647            parentBox->insertChildInternal(postBox, boxToSplit->nextSibling(), NotifyChildren);
    46484648            boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true);
    46494649
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r156262 r156278  
    27822782        // Takes care of adding the new child correctly if toBlock and fromBlock
    27832783        // have different kind of children (block vs inline).
    2784         toBoxModelObject->addChild(children()->removeChildNode(this, child), beforeChild);
    2785     } else
    2786         toBoxModelObject->children()->insertChildNode(toBoxModelObject, children()->removeChildNode(this, child, fullRemoveInsert), beforeChild, fullRemoveInsert);
     2784        removeChildInternal(child, NotifyChildren);
     2785        toBoxModelObject->addChild(child, beforeChild);
     2786    } else {
     2787        NotifyChildrenType notifyType = fullRemoveInsert ? NotifyChildren : DontNotifyChildren;
     2788        removeChildInternal(child, notifyType);
     2789        toBoxModelObject->insertChildInternal(child, beforeChild, notifyType);
     2790    }
    27872791}
    27882792
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r156262 r156278  
    2626#include "RenderElement.h"
    2727
     28#include "AXObjectCache.h"
    2829#include "ContentData.h"
     30#include "RenderCounter.h"
    2931#include "RenderDeprecatedFlexibleBox.h"
    3032#include "RenderFlexibleBox.h"
     
    3335#include "RenderImageResourceStyleImage.h"
    3436#include "RenderLayer.h"
     37#include "RenderLineBreak.h"
    3538#include "RenderListItem.h"
    3639#include "RenderMultiColumnBlock.h"
     
    4346#include "RenderTableRow.h"
    4447#include "RenderText.h"
     48#include "RenderView.h"
    4549#include "SVGRenderSupport.h"
    4650
     
    4953RenderElement::RenderElement(Element* element)
    5054    : RenderObject(element)
     55    , m_firstChild(nullptr)
     56    , m_lastChild(nullptr)
    5157{
    5258}
     
    137143void RenderElement::addChild(RenderObject* newChild, RenderObject* beforeChild)
    138144{
    139     ASSERT(children());
    140     RenderObjectChildList& children = *this->children();
    141 
    142145    bool needsTable = false;
    143146
     
    157160    if (needsTable) {
    158161        RenderTable* table;
    159         RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : children.lastChild();
     162        RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : m_lastChild;
    160163        if (afterChild && afterChild->isAnonymous() && afterChild->isTable() && !afterChild->isBeforeContent())
    161164            table = toRenderTable(afterChild);
     
    166169        table->addChild(newChild);
    167170    } else
    168         children.insertChildNode(this, newChild, beforeChild);
     171        insertChildInternal(newChild, beforeChild, NotifyChildren);
    169172
    170173    if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE)
     
    189192void RenderElement::removeChild(RenderObject* oldChild)
    190193{
    191     ASSERT(children());
    192     children()->removeChildNode(this, oldChild);
     194    removeChildInternal(oldChild, NotifyChildren);
     195}
     196
     197void RenderElement::destroyLeftoverChildren()
     198{
     199    while (m_firstChild) {
     200        if (m_firstChild->isListMarker() || (m_firstChild->style()->styleType() == FIRST_LETTER && !m_firstChild->isText()))
     201            m_firstChild->removeFromParent(); // List markers are owned by their enclosing list and so don't get destroyed by this container. Similarly, first letters are destroyed by their remaining text fragment.
     202        else if (m_firstChild->isRunIn() && m_firstChild->node()) {
     203            m_firstChild->node()->setRenderer(0);
     204            m_firstChild->node()->setNeedsStyleRecalc();
     205            m_firstChild->destroy();
     206        } else {
     207            // Destroy any anonymous children remaining in the render tree, as well as implicit (shadow) DOM elements like those used in the engine-based text fields.
     208            if (m_firstChild->node())
     209                m_firstChild->node()->setRenderer(0);
     210            m_firstChild->destroy();
     211        }
     212    }
     213}
     214
     215void RenderElement::insertChildInternal(RenderObject* newChild, RenderObject* beforeChild, NotifyChildrenType notifyChildren)
     216{
     217    ASSERT(canHaveChildren() || canHaveGeneratedChildren());
     218    ASSERT(!newChild->parent());
     219    ASSERT(!isRenderBlockFlow() || (!newChild->isTableSection() && !newChild->isTableRow() && !newChild->isTableCell()));
     220
     221    while (beforeChild && beforeChild->parent() && beforeChild->parent() != this)
     222        beforeChild = beforeChild->parent();
     223
     224    // This should never happen, but if it does prevent render tree corruption
     225    // where child->parent() ends up being owner but child->nextSibling()->parent()
     226    // is not owner.
     227    if (beforeChild && beforeChild->parent() != this) {
     228        ASSERT_NOT_REACHED();
     229        return;
     230    }
     231
     232    newChild->setParent(this);
     233
     234    if (m_firstChild == beforeChild)
     235        m_firstChild = newChild;
     236
     237    if (beforeChild) {
     238        RenderObject* previousSibling = beforeChild->previousSibling();
     239        if (previousSibling)
     240            previousSibling->setNextSibling(newChild);
     241        newChild->setPreviousSibling(previousSibling);
     242        newChild->setNextSibling(beforeChild);
     243        beforeChild->setPreviousSibling(newChild);
     244    } else {
     245        if (lastChild())
     246            lastChild()->setNextSibling(newChild);
     247        newChild->setPreviousSibling(lastChild());
     248        m_lastChild = newChild;
     249    }
     250
     251    if (!documentBeingDestroyed()) {
     252        if (notifyChildren == NotifyChildren)
     253            newChild->insertedIntoTree();
     254        RenderCounter::rendererSubtreeAttached(newChild);
     255    }
     256
     257    newChild->setNeedsLayoutAndPrefWidthsRecalc();
     258    setPreferredLogicalWidthsDirty(true);
     259    if (!normalChildNeedsLayout())
     260        setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.
     261
     262    if (AXObjectCache* cache = document().axObjectCache())
     263        cache->childrenChanged(this);
     264}
     265
     266void RenderElement::removeChildInternal(RenderObject* oldChild, NotifyChildrenType notifyChildren)
     267{
     268    ASSERT(canHaveChildren() || canHaveGeneratedChildren());
     269    ASSERT(oldChild->parent() == this);
     270
     271    if (oldChild->isFloatingOrOutOfFlowPositioned())
     272        toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists();
     273
     274    // So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or
     275    // that a positioned child got yanked). We also repaint, so that the area exposed when the child
     276    // disappears gets repainted properly.
     277    if (!documentBeingDestroyed() && notifyChildren == NotifyChildren && oldChild->everHadLayout()) {
     278        oldChild->setNeedsLayoutAndPrefWidthsRecalc();
     279        // We only repaint |oldChild| if we have a RenderLayer as its visual overflow may not be tracked by its parent.
     280        if (oldChild->isBody())
     281            view().repaintRootContents();
     282        else
     283            oldChild->repaint();
     284    }
     285
     286    // If we have a line box wrapper, delete it.
     287    if (oldChild->isBox())
     288        toRenderBox(oldChild)->deleteLineBoxWrapper();
     289    else if (oldChild->isLineBreak())
     290        toRenderLineBreak(oldChild)->deleteInlineBoxWrapper();
     291
     292    // If oldChild is the start or end of the selection, then clear the selection to
     293    // avoid problems of invalid pointers.
     294    // FIXME: The FrameSelection should be responsible for this when it
     295    // is notified of DOM mutations.
     296    if (!documentBeingDestroyed() && oldChild->isSelectionBorder())
     297        view().clearSelection();
     298
     299    if (!documentBeingDestroyed() && notifyChildren == NotifyChildren)
     300        oldChild->willBeRemovedFromTree();
     301
     302    // WARNING: There should be no code running between willBeRemovedFromTree and the actual removal below.
     303    // This is needed to avoid race conditions where willBeRemovedFromTree would dirty the tree's structure
     304    // and the code running here would force an untimely rebuilding, leaving |oldChild| dangling.
     305
     306    if (oldChild->previousSibling())
     307        oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
     308    if (oldChild->nextSibling())
     309        oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling());
     310
     311    if (m_firstChild == oldChild)
     312        m_firstChild = oldChild->nextSibling();
     313    if (m_lastChild == oldChild)
     314        m_lastChild = oldChild->previousSibling();
     315
     316    oldChild->setPreviousSibling(0);
     317    oldChild->setNextSibling(0);
     318    oldChild->setParent(0);
     319
     320    // rendererRemovedFromTree walks the whole subtree. We can improve performance
     321    // by skipping this step when destroying the entire tree.
     322    if (!documentBeingDestroyed())
     323        RenderCounter::rendererRemovedFromTree(oldChild);
     324
     325    if (AXObjectCache* cache = document().existingAXObjectCache())
     326        cache->childrenChanged(this);
    193327}
    194328
     
    347481}
    348482
    349 
    350 }
     483void RenderElement::willBeDestroyed()
     484{
     485    destroyLeftoverChildren();
     486
     487    RenderObject::willBeDestroyed();
     488}
     489
     490}
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156262 r156278  
    3939    Element* generatingElement() const { return toElement(RenderObject::generatingNode()); }
    4040
     41    virtual RenderObject* firstChild() const FINAL { return m_firstChild; }
     42    virtual RenderObject* lastChild() const FINAL { return m_lastChild; }
     43
    4144    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true; }
    4245    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
     
    5255    RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint, bool checkParent = true);
    5356
     57    enum NotifyChildrenType { NotifyChildren, DontNotifyChildren };
     58    void insertChildInternal(RenderObject*, RenderObject* beforeChild, NotifyChildrenType);
     59    void removeChildInternal(RenderObject*, NotifyChildrenType);
     60
    5461protected:
    5562    explicit RenderElement(Element*);
     
    6067    LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const;
    6168
     69    void setFirstChild(RenderObject* child) { m_firstChild = child; }
     70    void setLastChild(RenderObject* child) { m_lastChild = child; }
     71    void destroyLeftoverChildren();
     72
    6273    virtual void insertedIntoTree() OVERRIDE;
    6374    virtual void willBeRemovedFromTree() OVERRIDE;
     75    virtual void willBeDestroyed() OVERRIDE;
    6476
    6577private:
     
    6880    void generatingNode() const WTF_DELETED_FUNCTION;
    6981    void isText() const WTF_DELETED_FUNCTION;
     82
     83    RenderObject* m_firstChild;
     84    RenderObject* m_lastChild;
    7085};
    7186
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp

    r156262 r156278  
    495495
    496496    // This code copied from RenderMedia::layout().
    497     RenderObject* child = m_children.firstChild();
     497    RenderObject* child = firstChild();
    498498
    499499    if (!child)
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.h

    r156262 r156278  
    7373    virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE;
    7474
    75     virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }
    76     virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }
    77 
    7875protected:
    7976    virtual void layout() OVERRIDE;
     
    104101
    105102    virtual bool canHaveChildren() const OVERRIDE FINAL;
    106    
    107103    virtual bool canHaveWidget() const { return true; }
    108104
     
    115111    bool m_unavailablePluginIndicatorIsPressed;
    116112    bool m_mouseDownWasInUnavailablePluginIndicator;
    117     RenderObjectChildList m_children;
    118113    String m_unavailabilityDescription;
    119114};
  • trunk/Source/WebCore/rendering/RenderFrameSet.h

    r156262 r156278  
    6161    HTMLFrameSetElement& frameSetElement() const;
    6262
    63     RenderObject* firstChild() const { return m_children.firstChild(); }
    64     RenderObject* lastChild() const { return m_children.lastChild(); }
    65 
    66     virtual const RenderObjectChildList* children() const OVERRIDE { return &m_children; }
    67     virtual RenderObjectChildList* children() OVERRIDE { return &m_children; }
    68 
    6963    FrameEdgeInfo edgeInfo() const;
    7064
     
    10397    virtual void layout() OVERRIDE;
    10498    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
     99    virtual bool canHaveChildren() const OVERRIDE { return true; }
    105100    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE;
    106101    virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE;
     
    125120    void paintColumnBorder(const PaintInfo&, const IntRect&);
    126121
    127     RenderObjectChildList m_children;
    128 
    129122    GridAxis m_rows;
    130123    GridAxis m_cols;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r156262 r156278  
    8282    // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
    8383    // properly dirty line boxes that they are removed from.  Effects that do :before/:after only on hover could crash otherwise.
    84     children()->destroyLeftoverChildren();
     84    destroyLeftoverChildren();
    8585
    8686    // Destroy our continuation before anything other than anonymous children.
     
    367367        RenderObject* tmp = o;
    368368        o = tmp->nextSibling();
    369         cloneInline->addChildIgnoringContinuation(children()->removeChildNode(this, tmp), 0);
     369        removeChildInternal(tmp, NotifyChildren);
     370        cloneInline->addChildIgnoringContinuation(tmp, 0);
    370371        tmp->setNeedsLayoutAndPrefWidthsRecalc();
    371372    }
     
    408409                RenderObject* tmp = o;
    409410                o = tmp->nextSibling();
    410                 cloneInline->addChildIgnoringContinuation(inlineCurr->children()->removeChildNode(curr, tmp), 0);
     411                inlineCurr->removeChildInternal(tmp, NotifyChildren);
     412                cloneInline->addChildIgnoringContinuation(tmp, 0);
    411413                tmp->setNeedsLayoutAndPrefWidthsRecalc();
    412414            }
     
    420422
    421423    // Now we are at the block level. We need to put the clone into the toBlock.
    422     toBlock->children()->appendChildNode(toBlock, cloneInline);
     424    toBlock->insertChildInternal(cloneInline, nullptr, NotifyChildren);
    423425
    424426    // Now take all the children after currChild and remove them from the fromBlock
     
    428430        RenderObject* tmp = o;
    429431        o = tmp->nextSibling();
    430         toBlock->children()->appendChildNode(toBlock, fromBlock->children()->removeChildNode(fromBlock, tmp));
     432        fromBlock->removeChildInternal(tmp, NotifyChildren);
     433        toBlock->insertChildInternal(tmp, nullptr, NotifyChildren);
    431434    }
    432435}
     
    458461    RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
    459462    if (madeNewBeforeBlock)
    460         block->children()->insertChildNode(block, pre, boxFirst);
    461     block->children()->insertChildNode(block, newBlockBox, boxFirst);
    462     block->children()->insertChildNode(block, post, boxFirst);
     463        block->insertChildInternal(pre, boxFirst, NotifyChildren);
     464    block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren);
     465    block->insertChildInternal(post, boxFirst, NotifyChildren);
    463466    block->setChildrenInline(false);
    464467   
     
    468471            RenderObject* no = o;
    469472            o = no->nextSibling();
    470             pre->children()->appendChildNode(pre, block->children()->removeChildNode(block, no));
     473            block->removeChildInternal(no, NotifyChildren);
     474            pre->insertChildInternal(no, nullptr, NotifyChildren);
    471475            no->setNeedsLayoutAndPrefWidthsRecalc();
    472476        }
     
    12621266    setContinuation(newBox);
    12631267    RenderObject* beforeChild = child->nextSibling();
    1264     children()->removeChildNode(this, child);
     1268    removeChildInternal(child, NotifyChildren);
    12651269    splitFlow(beforeChild, newBox, child, oldContinuation);
    12661270}
  • trunk/Source/WebCore/rendering/RenderInline.h

    r156262 r156278  
    3737
    3838    static RenderInline* createAnonymous(Document&);
    39 
    40     RenderObject* firstChild() const { return m_children.firstChild(); }
    41     RenderObject* lastChild() const { return m_children.lastChild(); }
    4239
    4340    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE;
     
    10097
    10198private:
    102     virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }
    103     virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }
    104 
    10599    virtual const char* renderName() const OVERRIDE;
    106100
    107101    virtual bool isRenderInline() const OVERRIDE FINAL { return true; }
     102    virtual bool canHaveChildren() const OVERRIDE FINAL { return true; }
    108103
    109104    LayoutRect culledInlineVisualOverflowBoundingBox() const;
     
    179174    RenderBoxModelObject* continuationBefore(RenderObject* beforeChild);
    180175
    181     RenderObjectChildList m_children;
    182176    RenderLineBoxList m_lineBoxes;   // All of the line boxes created for this inline flow.  For example, <i>Hello<br>world.</i> will have two <i> line boxes.
    183177
  • trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp

    r156262 r156278  
    8282
    8383    // RenderObject::willBeDestroyed calls back to destroyLayer() for layer destruction
    84     RenderObject::willBeDestroyed();
     84    RenderElement::willBeDestroyed();
    8585}
    8686
  • trunk/Source/WebCore/rendering/RenderLineBreak.h

    r156262 r156278  
    5454private:
    5555    void node() const WTF_DELETED_FUNCTION;
     56
     57    virtual bool canHaveChildren() const OVERRIDE { return false; }
    5658
    5759    virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE;
  • trunk/Source/WebCore/rendering/RenderListMarker.h

    r156262 r156278  
    5656
    5757    virtual bool isListMarker() const { return true; }
     58    virtual bool canHaveChildren() const OVERRIDE { return false; }
    5859
    5960    virtual void paint(PaintInfo&, const LayoutPoint&);
  • trunk/Source/WebCore/rendering/RenderMedia.cpp

    r156262 r156278  
    5959    RenderImage::layout();
    6060
    61     RenderBox* controlsRenderer = toRenderBox(m_children.firstChild());
     61    RenderBox* controlsRenderer = toRenderBox(firstChild());
    6262    if (!controlsRenderer)
    6363        return;
  • trunk/Source/WebCore/rendering/RenderMedia.h

    r156262 r156278  
    4242    HTMLMediaElement& mediaElement() const { return toHTMLMediaElement(nodeForNonAnonymous()); }
    4343
    44     RenderObject* firstChild() const { return m_children.firstChild(); }
    45     RenderObject* lastChild() const { return m_children.lastChild(); }
    46 
    47     virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }
    48     virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }
    49 
    5044protected:
    5145    virtual void layout();
     
    6256
    6357    virtual bool requiresForcedStyleRecalcPropagation() const OVERRIDE FINAL { return true; }
    64 
    65     RenderObjectChildList m_children;
    6658};
    6759
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r156262 r156278  
    16641664            // An anonymous block must be made to wrap this inline.
    16651665            RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock();
    1666             RenderObjectChildList* childlist = parent()->children();
    1667             childlist->insertChildNode(parent(), block, this);
    1668             block->children()->appendChildNode(block, childlist->removeChildNode(parent(), this));
     1666            parent()->insertChildInternal(block, this, RenderElement::NotifyChildren);
     1667            parent()->removeChildInternal(this, RenderElement::NotifyChildren);
     1668            block->insertChildInternal(this, nullptr, RenderElement::NotifyChildren);
    16691669        }
    16701670    }
     
    24112411void RenderObject::willBeDestroyed()
    24122412{
    2413     // Destroy any leftover anonymous children.
    2414     RenderObjectChildList* children = this->children();
    2415     if (children)
    2416         children->destroyLeftoverChildren();
    2417 
    24182413    // If this renderer is being autoscrolled, stop the autoscroll timer
    24192414   
     
    25212516void RenderObject::removeFromRenderFlowThreadRecursive(RenderFlowThread* renderFlowThread)
    25222517{
    2523     if (const RenderObjectChildList* children = this->children()) {
    2524         for (RenderObject* child = children->firstChild(); child; child = child->nextSibling())
    2525             child->removeFromRenderFlowThreadRecursive(renderFlowThread);
    2526     }
    2527    
     2518    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
     2519        child->removeFromRenderFlowThreadRecursive(renderFlowThread);
     2520
    25282521    RenderFlowThread* localFlowThread = renderFlowThread;
    25292522    if (flowThreadState() == InsideInFlowThread)
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156262 r156278  
    3333#include "LayoutRect.h"
    3434#include "PaintPhase.h"
    35 #include "RenderObjectChildList.h"
    3635#include "RenderStyle.h"
    3736#include "ScrollBehavior.h"
     
    148147    friend class RenderBlock;
    149148    friend class RenderBlockFlow;
     149    friend class RenderElement;
    150150    friend class RenderLayer;
    151     friend class RenderObjectChildList;
    152151public:
    153152    // Anonymous objects should pass the document as their node, and they will then automatically be
     
    167166
    168167    // FIXME: These should be renamed slowFirstChild, slowLastChild, etc.
    169     // to discourage their use. The virtual call to children inside these
    170     // can be slow for hot code paths.
    171     // Derived classes like RenderBlock override these non-virtual
    172     // functions to make them fast when we already have a more specific pointer type.
    173     RenderObject* firstChild() const
    174     {
    175         if (const RenderObjectChildList* children = this->children())
    176             return children->firstChild();
    177         return 0;
    178     }
    179     RenderObject* lastChild() const
    180     {
    181         if (const RenderObjectChildList* children = this->children())
    182             return children->lastChild();
    183         return 0;
    184     }
    185 
    186     virtual RenderObjectChildList* children() { return 0; }
    187     virtual const RenderObjectChildList* children() const { return 0; }
     168    // to discourage their use.
     169    virtual RenderObject* firstChild() const { return nullptr; }
     170    virtual RenderObject* lastChild() const { return nullptr; }
    188171
    189172    RenderObject* nextInPreOrder() const;
     
    271254    // RenderObject tree manipulation
    272255    //////////////////////////////////////////
    273     virtual bool canHaveChildren() const { return children(); }
     256    virtual bool canHaveChildren() const = 0;
    274257    virtual bool canHaveGeneratedChildren() const;
    275258    virtual bool createsAnonymousWrapper() const { return false; }
  • trunk/Source/WebCore/rendering/RenderReplaced.h

    r156262 r156278  
    7373    virtual const char* renderName() const OVERRIDE { return "RenderReplaced"; }
    7474
    75     virtual bool canHaveChildren() const { return false; }
     75    virtual bool canHaveChildren() const OVERRIDE { return false; }
    7676
    7777    virtual void computePreferredLogicalWidths() OVERRIDE FINAL;
  • trunk/Source/WebCore/rendering/RenderReplica.h

    r156262 r156278  
    5151    RenderReplica();
    5252
    53     virtual bool isReplica() const { return true; }
    54     virtual void computePreferredLogicalWidths();
     53    virtual bool isReplica() const OVERRIDE { return true; }
     54    virtual bool canHaveChildren() const OVERRIDE { return false; }
     55    virtual void computePreferredLogicalWidths() OVERRIDE;
    5556
    5657};
  • trunk/Source/WebCore/rendering/RenderRubyBase.cpp

    r156262 r156278  
    9999        else {
    100100            toBlock = toBase->createAnonymousBlock();
    101             toBase->children()->appendChildNode(toBase, toBlock);
     101            toBase->insertChildInternal(toBlock, nullptr, NotifyChildren);
    102102        }
    103103    }
     
    124124        RenderBlock* anonBlockHere = toRenderBlock(firstChildHere);
    125125        RenderBlock* anonBlockThere = toRenderBlock(lastChildThere);
    126         anonBlockHere->moveAllChildrenTo(anonBlockThere, anonBlockThere->children());
     126        anonBlockHere->moveAllChildrenTo(anonBlockThere, true);
    127127        anonBlockHere->deleteLineBoxTree();
    128128        anonBlockHere->destroy();
  • trunk/Source/WebCore/rendering/RenderTableCol.h

    r156262 r156278  
    3838    explicit RenderTableCol(Element&);
    3939    Element& element() const { return toElement(nodeForNonAnonymous()); }
    40 
    41     RenderObject* firstChild() const { return m_children.firstChild(); }
    42     RenderObject* lastChild() const { return m_children.lastChild(); }
    43 
    44     virtual const RenderObjectChildList* children() const OVERRIDE { return &m_children; }
    45     virtual RenderObjectChildList* children() OVERRIDE { return &m_children; }
    4640
    4741    void clearPreferredLogicalWidthsDirtyBits();
     
    9892    RenderTable* table() const;
    9993
    100     RenderObjectChildList m_children;
    10194    unsigned m_span;
    10295};
  • trunk/Source/WebCore/rendering/RenderTableRow.h

    r156262 r156278  
    3636public:
    3737    explicit RenderTableRow(Element*);
    38 
    39     RenderObject* firstChild() const { return m_children.firstChild(); }
    40     RenderObject* lastChild() const { return m_children.lastChild(); }
    41 
    42     virtual const RenderObjectChildList* children() const OVERRIDE { return &m_children; }
    43     virtual RenderObjectChildList* children() OVERRIDE { return &m_children; }
    4438
    4539    RenderTableSection* section() const { return toRenderTableSection(parent()); }
     
    9690    virtual bool isTableRow() const OVERRIDE { return true; }
    9791
     92    virtual bool canHaveChildren() const OVERRIDE { return true; }
    9893    virtual void willBeRemovedFromTree() OVERRIDE;
    9994
     
    110105    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
    111106
    112     RenderObjectChildList m_children;
    113107    unsigned m_rowIndex : 31;
    114108};
  • trunk/Source/WebCore/rendering/RenderTableSection.h

    r156262 r156278  
    6666    virtual ~RenderTableSection();
    6767
    68     RenderObject* firstChild() const { return m_children.firstChild(); }
    69     RenderObject* lastChild() const { return m_children.lastChild(); }
    70 
    71     virtual const RenderObjectChildList* children() const OVERRIDE { return &m_children; }
    72     virtual RenderObjectChildList* children() OVERRIDE { return &m_children; }
    73 
    7468    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE;
    7569
     
    205199    virtual const char* renderName() const OVERRIDE { return (isAnonymous() || isPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
    206200
     201    virtual bool canHaveChildren() const OVERRIDE { return true; }
     202
    207203    virtual bool isTableSection() const OVERRIDE { return true; }
    208204
     
    242238
    243239    void setLogicalPositionForCell(RenderTableCell*, unsigned effectiveColumn) const;
    244 
    245     RenderObjectChildList m_children;
    246240
    247241    Vector<RowStruct> m_grid;
  • trunk/Source/WebCore/rendering/RenderText.h

    r156262 r156278  
    159159
    160160private:
     161    virtual bool canHaveChildren() const OVERRIDE FINAL { return false; }
     162
    161163    void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&);
    162164
  • trunk/Source/WebCore/rendering/RenderingAllInOne.cpp

    r156262 r156278  
    8585#include "RenderMultiColumnSet.cpp"
    8686#include "RenderObject.cpp"
    87 #include "RenderObjectChildList.cpp"
    8887#include "RenderProgress.cpp"
    8988#include "RenderQuote.cpp"
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r156262 r156278  
    140140
    141141    // Destroy our current children
    142     children()->destroyLeftoverChildren();
     142    destroyLeftoverChildren();
    143143
    144144    // Since we share a node with our children, destroying our children may set our node's
  • trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h

    r156262 r156278  
    3636    virtual ~RenderSVGContainer();
    3737
    38     RenderObject* firstChild() const { return m_children.firstChild(); }
    39     RenderObject* lastChild() const { return m_children.lastChild(); }
    40 
    41     virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }
    42     virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }
    43 
    4438    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
    4539    virtual void setNeedsBoundariesUpdate() OVERRIDE FINAL { m_needsBoundariesUpdate = true; }
     
    5347    virtual bool isSVGContainer() const OVERRIDE FINAL { return true; }
    5448    virtual const char* renderName() const OVERRIDE { return "RenderSVGContainer"; }
     49
     50    virtual bool canHaveChildren() const OVERRIDE FINAL { return true; }
    5551
    5652    virtual void layout() OVERRIDE;
     
    8076
    8177private:
    82     RenderObjectChildList m_children;
    8378    FloatRect m_objectBoundingBox;
    8479    bool m_objectBoundingBoxValid;
  • trunk/Source/WebCore/rendering/svg/RenderSVGGradientStop.h

    r156262 r156278  
    5454
    5555private:
     56    virtual bool canHaveChildren() const OVERRIDE { return false; }
     57
    5658    SVGGradientElement* gradientElement() const;
    5759};
  • trunk/Source/WebCore/rendering/svg/RenderSVGImage.h

    r156262 r156278  
    6060    virtual const char* renderName() const { return "RenderSVGImage"; }
    6161    virtual bool isSVGImage() const OVERRIDE { return true; }
     62    virtual bool canHaveChildren() const OVERRIDE { return false; }
    6263
    6364    virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
  • trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

    r156262 r156278  
    9696{
    9797    SVGResourcesCache::clientDestroyed(this);
    98     RenderObject::willBeDestroyed();
     98    RenderElement::willBeDestroyed();
    9999}
    100100
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h

    r156262 r156278  
    4646
    4747    virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const OVERRIDE;
    48 
    49     RenderObject* firstChild() const { return m_children.firstChild(); }
    50     RenderObject* lastChild() const { return m_children.lastChild(); }
    51 
    52     virtual const RenderObjectChildList* children() const OVERRIDE { return &m_children; }
    53     virtual RenderObjectChildList* children() OVERRIDE { return &m_children; }
    5448
    5549    bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
     
    116110    void buildLocalToBorderBoxTransform();
    117111
    118     RenderObjectChildList m_children;
    119112    IntSize m_containerSize;
    120113    FloatRect m_objectBoundingBox;
  • trunk/Source/WebCore/rendering/svg/RenderSVGShape.h

    r156262 r156278  
    116116
    117117    virtual bool isSVGShape() const OVERRIDE FINAL { return true; }
     118    virtual bool canHaveChildren() const OVERRIDE FINAL { return false; }
    118119    virtual const char* renderName() const { return "RenderSVGShape"; }
    119120
Note: See TracChangeset for help on using the changeset viewer.