Changeset 156278 in webkit
- Timestamp:
- Sep 23, 2013, 10:43:04 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r156267 r156278 2179 2179 rendering/RenderNamedFlowThread.cpp 2180 2180 rendering/RenderObject.cpp 2181 rendering/RenderObjectChildList.cpp2182 2181 rendering/RenderProgress.cpp 2183 2182 rendering/RenderQuote.cpp -
trunk/Source/WebCore/ChangeLog
r156274 r156278 1 2013-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 1 13 2013-09-23 Andreas Kling <akling@apple.com> 2 14 -
trunk/Source/WebCore/GNUmakefile.list.am
r156262 r156278 4505 4505 Source/WebCore/rendering/RenderNamedFlowThread.cpp \ 4506 4506 Source/WebCore/rendering/RenderNamedFlowThread.h \ 4507 Source/WebCore/rendering/RenderObjectChildList.cpp \4508 Source/WebCore/rendering/RenderObjectChildList.h \4509 4507 Source/WebCore/rendering/RenderObject.cpp \ 4510 4508 Source/WebCore/rendering/RenderObject.h \ -
trunk/Source/WebCore/Target.pri
r156262 r156278 1195 1195 rendering/RenderNamedFlowThread.cpp \ 1196 1196 rendering/RenderObject.cpp \ 1197 rendering/RenderObjectChildList.cpp \1198 1197 rendering/RenderProgress.cpp \ 1199 1198 rendering/RenderQuote.cpp \ … … 2462 2461 rendering/RenderMeter.h \ 2463 2462 rendering/RenderMultiColumnBlock.h \ 2464 rendering/RenderObjectChildList.h \2465 2463 rendering/RenderObject.h \ 2466 2464 rendering/RenderProgress.h \ -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r156262 r156278 10240 10240 <ClCompile Include="..\rendering\RenderNamedFlowThread.cpp" /> 10241 10241 <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">10256 10242 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> 10257 10243 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> … … 20006 19992 <ClInclude Include="..\rendering\RenderNamedFlowThread.h" /> 20007 19993 <ClInclude Include="..\rendering\RenderObject.h" /> 20008 <ClInclude Include="..\rendering\RenderObjectChildList.h" />20009 19994 <ClInclude Include="..\rendering\RenderProgress.h" /> 20010 19995 <ClInclude Include="..\rendering\RenderQuote.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r156262 r156278 4769 4769 BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */; }; 4770 4770 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, ); }; };4772 4771 BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */; }; 4773 4772 BC2ED6BC0C6BD2F000920BFF /* JSAttrCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */; }; … … 4889 4888 BC60DB490D2A3D1E00B9918F /* JSXPathException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */; }; 4890 4889 BC60DB4A0D2A3D1E00B9918F /* JSXPathException.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60DB480D2A3D1E00B9918F /* JSXPathException.h */; }; 4891 BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60EFB60F33A0E700812A93 /* RenderObjectChildList.cpp */; };4892 4890 BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64640711D7F304006455B0 /* DOMStringMap.cpp */; }; 4893 4891 BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64640811D7F304006455B0 /* DOMStringMap.h */; }; … … 11632 11630 BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextEvent.h; sourceTree = "<group>"; }; 11633 11631 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>"; };11635 11632 BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; }; 11636 11633 BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttrCustom.cpp; sourceTree = "<group>"; }; … … 11761 11758 BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathException.cpp; sourceTree = "<group>"; }; 11762 11759 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>"; };11764 11760 BC64640711D7F304006455B0 /* DOMStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMStringMap.cpp; sourceTree = "<group>"; }; 11765 11761 BC64640811D7F304006455B0 /* DOMStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringMap.h; sourceTree = "<group>"; }; … … 20632 20628 BCEA4840097D93020094C9E4 /* RenderObject.cpp */, 20633 20629 BCEA4841097D93020094C9E4 /* RenderObject.h */, 20634 BC60EFB60F33A0E700812A93 /* RenderObjectChildList.cpp */,20635 BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */,20636 20630 BCFA930710333193007B25D1 /* RenderOverflow.h */, 20637 20631 A43BF59A1149292800C643CA /* RenderProgress.cpp */, … … 23777 23771 BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */, 23778 23772 BCEA4880097D93020094C9E4 /* RenderObject.h in Headers */, 23779 BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */,23780 23773 BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */, 23781 23774 A43BF59D1149292800C643CA /* RenderProgress.h in Headers */, … … 26997 26990 1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */, 26998 26991 BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */, 26999 BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */,27000 26992 A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */, 27001 26993 5A574F24131DB93900471B88 /* RenderQuote.cpp in Sources */, -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r156262 r156278 50 50 RenderTableCell* maxContributor = 0; 51 51 52 for (RenderObject* child = m_table-> children()->firstChild(); child; child = child->nextSibling()) {52 for (RenderObject* child = m_table->firstChild(); child; child = child->nextSibling()) { 53 53 if (child->isRenderTableCol()){ 54 54 // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits … … 66 66 continue; 67 67 68 bool cellHasContent = cell-> children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();68 bool cellHasContent = cell->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding(); 69 69 if (cellHasContent) 70 70 columnLayout.emptyCellsOnly = false; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r156262 r156278 85 85 struct SameSizeAsRenderBlock : public RenderBox { 86 86 void* pointers[2]; 87 RenderObjectChildList children;88 87 RenderLineBoxList lineBoxes; 89 88 uint32_t bitfields; … … 214 213 // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will 215 214 // 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(); 217 216 218 217 // Destroy our continuation before anything other than anonymous children. … … 469 468 // Create a new block of the correct type. 470 469 RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock(); 471 children()->appendChildNode(this, newBox);470 insertChildInternal(newBox, nullptr, NotifyChildren); 472 471 newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); 473 472 return; … … 492 491 // Create a new anonymous box of the appropriate type. 493 492 RenderBlock* newBox = newChildHasColumnSpan ? createAnonymousColumnSpanBlock() : createAnonymousColumnsBlock(); 494 children()->insertChildNode(this, newBox, newBeforeChild);493 insertChildInternal(newBox, newBeforeChild, NotifyChildren); 495 494 newBox->addChildIgnoringAnonymousColumnBlocks(newChild, 0); 496 495 return; … … 609 608 610 609 // 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); 612 611 613 612 // Now take all the children after currChild and remove them from the fromBlock … … 644 643 RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling(); 645 644 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); 649 648 block->setChildrenInline(false); 650 649 … … 696 695 RenderObject* boxFirst = block->firstChild(); 697 696 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); 700 699 if (post) 701 block-> children()->insertChildNode(block, post, boxFirst);700 block->insertChildInternal(post, boxFirst, NotifyChildren); 702 701 block->setChildrenInline(false); 703 702 … … 1006 1005 1007 1006 RenderBlock* block = createAnonymousBlock(); 1008 children()->insertChildNode(this, block, inlineRunStart);1007 insertChildInternal(block, inlineRunStart, NotifyChildren); 1009 1008 moveChildrenTo(block, inlineRunStart, child); 1010 1009 } … … 1026 1025 return; 1027 1026 1028 RenderObject* firstAnChild = child-> m_children.firstChild();1029 RenderObject* lastAnChild = child-> m_children.lastChild();1027 RenderObject* firstAnChild = child->firstChild(); 1028 RenderObject* lastAnChild = child->lastChild(); 1030 1029 if (firstAnChild) { 1031 1030 RenderObject* o = firstAnChild; … … 1041 1040 child->nextSibling()->setPreviousSibling(lastAnChild); 1042 1041 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); 1047 1046 } 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()); 1052 1051 1053 1052 if (child->previousSibling()) … … 1057 1056 } 1058 1057 1059 child-> children()->setFirstChild(0);1058 child->setFirstChild(0); 1060 1059 child->m_next = 0; 1061 1060 … … 1095 1094 } 1096 1095 1097 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, Render Object* child)1096 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child) 1098 1097 { 1099 1098 parent->setNeedsLayoutAndPrefWidthsRecalc(); … … 1103 1102 RenderFlowThread* childFlowThread = child->flowThreadContainingBlock(); 1104 1103 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()); 1108 1107 // Delete the now-empty block's lines and nuke it. 1109 anonBlock->deleteLineBoxTree();1108 child->deleteLineBoxTree(); 1110 1109 if (childFlowThread && childFlowThread->isRenderNamedFlowThread()) 1111 toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo( anonBlock);1112 anonBlock->destroy();1110 toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo(child); 1111 child->destroy(); 1113 1112 } 1114 1113 … … 1189 1188 bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer(); 1190 1189 inlineChildrenBlock->setStyle(newStyle); 1191 children()->removeChildNode(this, inlineChildrenBlock, inlineChildrenBlockHasLayer);1190 removeChildInternal(inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren); 1192 1191 1193 1192 // 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); 1196 1196 next->setNeedsLayoutAndPrefWidthsRecalc(); 1197 1197 … … 1221 1221 // box. We can go ahead and pull the content right back up into our 1222 1222 // box. 1223 collapseAnonymousBoxChild(this, child);1223 collapseAnonymousBoxChild(this, toRenderBlock(child)); 1224 1224 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && canCollapseAnonymousBlockChild()) { 1225 1225 // It's possible that the removal has knocked us down to a single anonymous … … 5846 5846 // To prevent removal of single anonymous block in RenderBlock::removeChild and causing 5847 5847 // |nextSibling| to go stale, we remove the old first letter using removeChildNode first. 5848 firstLetterContainer-> children()->removeChildNode(firstLetterContainer, firstLetter);5848 firstLetterContainer->removeChildInternal(firstLetter, NotifyChildren); 5849 5849 firstLetter->destroy(); 5850 5850 firstLetter = newFirstLetter; -
trunk/Source/WebCore/rendering/RenderBlock.h
r156262 r156278 105 105 static RenderBlock* createAnonymous(Document&); 106 106 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 113 107 bool beingDestroyed() const { return m_beingDestroyed; } 114 108 … … 293 287 RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); } 294 288 RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); } 295 static void collapseAnonymousBoxChild(RenderBlock* parent, Render Object* child);289 static void collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child); 296 290 297 291 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE; … … 572 566 virtual bool isRenderBlock() const OVERRIDE FINAL { return true; } 573 567 virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() && isReplaced(); } 568 virtual bool canHaveChildren() const OVERRIDE { return true; } 574 569 575 570 void makeChildrenNonInline(RenderObject* insertionPoint = 0); … … 879 874 OwnPtr<RenderBlockRareData> m_rareData; 880 875 881 RenderObjectChildList m_children;882 876 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>. 883 877 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r156262 r156278 4645 4645 // See for example RenderTableCell:clippedOverflowRectForRepaint. 4646 4646 markBoxForRelayoutAfterSplit(parentBox); 4647 parentBox-> children()->insertChildNode(parentBox, postBox, boxToSplit->nextSibling());4647 parentBox->insertChildInternal(postBox, boxToSplit->nextSibling(), NotifyChildren); 4648 4648 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); 4649 4649 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r156262 r156278 2782 2782 // Takes care of adding the new child correctly if toBlock and fromBlock 2783 2783 // 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 } 2787 2791 } 2788 2792 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r156262 r156278 26 26 #include "RenderElement.h" 27 27 28 #include "AXObjectCache.h" 28 29 #include "ContentData.h" 30 #include "RenderCounter.h" 29 31 #include "RenderDeprecatedFlexibleBox.h" 30 32 #include "RenderFlexibleBox.h" … … 33 35 #include "RenderImageResourceStyleImage.h" 34 36 #include "RenderLayer.h" 37 #include "RenderLineBreak.h" 35 38 #include "RenderListItem.h" 36 39 #include "RenderMultiColumnBlock.h" … … 43 46 #include "RenderTableRow.h" 44 47 #include "RenderText.h" 48 #include "RenderView.h" 45 49 #include "SVGRenderSupport.h" 46 50 … … 49 53 RenderElement::RenderElement(Element* element) 50 54 : RenderObject(element) 55 , m_firstChild(nullptr) 56 , m_lastChild(nullptr) 51 57 { 52 58 } … … 137 143 void RenderElement::addChild(RenderObject* newChild, RenderObject* beforeChild) 138 144 { 139 ASSERT(children());140 RenderObjectChildList& children = *this->children();141 142 145 bool needsTable = false; 143 146 … … 157 160 if (needsTable) { 158 161 RenderTable* table; 159 RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : children.lastChild();162 RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : m_lastChild; 160 163 if (afterChild && afterChild->isAnonymous() && afterChild->isTable() && !afterChild->isBeforeContent()) 161 164 table = toRenderTable(afterChild); … … 166 169 table->addChild(newChild); 167 170 } else 168 children.insertChildNode(this, newChild, beforeChild);171 insertChildInternal(newChild, beforeChild, NotifyChildren); 169 172 170 173 if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE) … … 189 192 void RenderElement::removeChild(RenderObject* oldChild) 190 193 { 191 ASSERT(children()); 192 children()->removeChildNode(this, oldChild); 194 removeChildInternal(oldChild, NotifyChildren); 195 } 196 197 void 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 215 void 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 266 void 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); 193 327 } 194 328 … … 347 481 } 348 482 349 350 } 483 void RenderElement::willBeDestroyed() 484 { 485 destroyLeftoverChildren(); 486 487 RenderObject::willBeDestroyed(); 488 } 489 490 } -
trunk/Source/WebCore/rendering/RenderElement.h
r156262 r156278 39 39 Element* generatingElement() const { return toElement(RenderObject::generatingNode()); } 40 40 41 virtual RenderObject* firstChild() const FINAL { return m_firstChild; } 42 virtual RenderObject* lastChild() const FINAL { return m_lastChild; } 43 41 44 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true; } 42 45 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0); … … 52 55 RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint, bool checkParent = true); 53 56 57 enum NotifyChildrenType { NotifyChildren, DontNotifyChildren }; 58 void insertChildInternal(RenderObject*, RenderObject* beforeChild, NotifyChildrenType); 59 void removeChildInternal(RenderObject*, NotifyChildrenType); 60 54 61 protected: 55 62 explicit RenderElement(Element*); … … 60 67 LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const; 61 68 69 void setFirstChild(RenderObject* child) { m_firstChild = child; } 70 void setLastChild(RenderObject* child) { m_lastChild = child; } 71 void destroyLeftoverChildren(); 72 62 73 virtual void insertedIntoTree() OVERRIDE; 63 74 virtual void willBeRemovedFromTree() OVERRIDE; 75 virtual void willBeDestroyed() OVERRIDE; 64 76 65 77 private: … … 68 80 void generatingNode() const WTF_DELETED_FUNCTION; 69 81 void isText() const WTF_DELETED_FUNCTION; 82 83 RenderObject* m_firstChild; 84 RenderObject* m_lastChild; 70 85 }; 71 86 -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp
r156262 r156278 495 495 496 496 // This code copied from RenderMedia::layout(). 497 RenderObject* child = m_children.firstChild();497 RenderObject* child = firstChild(); 498 498 499 499 if (!child) -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.h
r156262 r156278 73 73 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE; 74 74 75 virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }76 virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }77 78 75 protected: 79 76 virtual void layout() OVERRIDE; … … 104 101 105 102 virtual bool canHaveChildren() const OVERRIDE FINAL; 106 107 103 virtual bool canHaveWidget() const { return true; } 108 104 … … 115 111 bool m_unavailablePluginIndicatorIsPressed; 116 112 bool m_mouseDownWasInUnavailablePluginIndicator; 117 RenderObjectChildList m_children;118 113 String m_unavailabilityDescription; 119 114 }; -
trunk/Source/WebCore/rendering/RenderFrameSet.h
r156262 r156278 61 61 HTMLFrameSetElement& frameSetElement() const; 62 62 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 69 63 FrameEdgeInfo edgeInfo() const; 70 64 … … 103 97 virtual void layout() OVERRIDE; 104 98 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 99 virtual bool canHaveChildren() const OVERRIDE { return true; } 105 100 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; 106 101 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE; … … 125 120 void paintColumnBorder(const PaintInfo&, const IntRect&); 126 121 127 RenderObjectChildList m_children;128 129 122 GridAxis m_rows; 130 123 GridAxis m_cols; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r156262 r156278 82 82 // Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will 83 83 // 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(); 85 85 86 86 // Destroy our continuation before anything other than anonymous children. … … 367 367 RenderObject* tmp = o; 368 368 o = tmp->nextSibling(); 369 cloneInline->addChildIgnoringContinuation(children()->removeChildNode(this, tmp), 0); 369 removeChildInternal(tmp, NotifyChildren); 370 cloneInline->addChildIgnoringContinuation(tmp, 0); 370 371 tmp->setNeedsLayoutAndPrefWidthsRecalc(); 371 372 } … … 408 409 RenderObject* tmp = o; 409 410 o = tmp->nextSibling(); 410 cloneInline->addChildIgnoringContinuation(inlineCurr->children()->removeChildNode(curr, tmp), 0); 411 inlineCurr->removeChildInternal(tmp, NotifyChildren); 412 cloneInline->addChildIgnoringContinuation(tmp, 0); 411 413 tmp->setNeedsLayoutAndPrefWidthsRecalc(); 412 414 } … … 420 422 421 423 // 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); 423 425 424 426 // Now take all the children after currChild and remove them from the fromBlock … … 428 430 RenderObject* tmp = o; 429 431 o = tmp->nextSibling(); 430 toBlock->children()->appendChildNode(toBlock, fromBlock->children()->removeChildNode(fromBlock, tmp)); 432 fromBlock->removeChildInternal(tmp, NotifyChildren); 433 toBlock->insertChildInternal(tmp, nullptr, NotifyChildren); 431 434 } 432 435 } … … 458 461 RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling(); 459 462 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); 463 466 block->setChildrenInline(false); 464 467 … … 468 471 RenderObject* no = o; 469 472 o = no->nextSibling(); 470 pre->children()->appendChildNode(pre, block->children()->removeChildNode(block, no)); 473 block->removeChildInternal(no, NotifyChildren); 474 pre->insertChildInternal(no, nullptr, NotifyChildren); 471 475 no->setNeedsLayoutAndPrefWidthsRecalc(); 472 476 } … … 1262 1266 setContinuation(newBox); 1263 1267 RenderObject* beforeChild = child->nextSibling(); 1264 children()->removeChildNode(this, child);1268 removeChildInternal(child, NotifyChildren); 1265 1269 splitFlow(beforeChild, newBox, child, oldContinuation); 1266 1270 } -
trunk/Source/WebCore/rendering/RenderInline.h
r156262 r156278 37 37 38 38 static RenderInline* createAnonymous(Document&); 39 40 RenderObject* firstChild() const { return m_children.firstChild(); }41 RenderObject* lastChild() const { return m_children.lastChild(); }42 39 43 40 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE; … … 100 97 101 98 private: 102 virtual const RenderObjectChildList* children() const OVERRIDE FINAL { return &m_children; }103 virtual RenderObjectChildList* children() OVERRIDE FINAL { return &m_children; }104 105 99 virtual const char* renderName() const OVERRIDE; 106 100 107 101 virtual bool isRenderInline() const OVERRIDE FINAL { return true; } 102 virtual bool canHaveChildren() const OVERRIDE FINAL { return true; } 108 103 109 104 LayoutRect culledInlineVisualOverflowBoundingBox() const; … … 179 174 RenderBoxModelObject* continuationBefore(RenderObject* beforeChild); 180 175 181 RenderObjectChildList m_children;182 176 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. 183 177 -
trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp
r156262 r156278 82 82 83 83 // RenderObject::willBeDestroyed calls back to destroyLayer() for layer destruction 84 Render Object::willBeDestroyed();84 RenderElement::willBeDestroyed(); 85 85 } 86 86 -
trunk/Source/WebCore/rendering/RenderLineBreak.h
r156262 r156278 54 54 private: 55 55 void node() const WTF_DELETED_FUNCTION; 56 57 virtual bool canHaveChildren() const OVERRIDE { return false; } 56 58 57 59 virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE; -
trunk/Source/WebCore/rendering/RenderListMarker.h
r156262 r156278 56 56 57 57 virtual bool isListMarker() const { return true; } 58 virtual bool canHaveChildren() const OVERRIDE { return false; } 58 59 59 60 virtual void paint(PaintInfo&, const LayoutPoint&); -
trunk/Source/WebCore/rendering/RenderMedia.cpp
r156262 r156278 59 59 RenderImage::layout(); 60 60 61 RenderBox* controlsRenderer = toRenderBox( m_children.firstChild());61 RenderBox* controlsRenderer = toRenderBox(firstChild()); 62 62 if (!controlsRenderer) 63 63 return; -
trunk/Source/WebCore/rendering/RenderMedia.h
r156262 r156278 42 42 HTMLMediaElement& mediaElement() const { return toHTMLMediaElement(nodeForNonAnonymous()); } 43 43 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 50 44 protected: 51 45 virtual void layout(); … … 62 56 63 57 virtual bool requiresForcedStyleRecalcPropagation() const OVERRIDE FINAL { return true; } 64 65 RenderObjectChildList m_children;66 58 }; 67 59 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r156262 r156278 1664 1664 // An anonymous block must be made to wrap this inline. 1665 1665 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); 1669 1669 } 1670 1670 } … … 2411 2411 void RenderObject::willBeDestroyed() 2412 2412 { 2413 // Destroy any leftover anonymous children.2414 RenderObjectChildList* children = this->children();2415 if (children)2416 children->destroyLeftoverChildren();2417 2418 2413 // If this renderer is being autoscrolled, stop the autoscroll timer 2419 2414 … … 2521 2516 void RenderObject::removeFromRenderFlowThreadRecursive(RenderFlowThread* renderFlowThread) 2522 2517 { 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 2528 2521 RenderFlowThread* localFlowThread = renderFlowThread; 2529 2522 if (flowThreadState() == InsideInFlowThread) -
trunk/Source/WebCore/rendering/RenderObject.h
r156262 r156278 33 33 #include "LayoutRect.h" 34 34 #include "PaintPhase.h" 35 #include "RenderObjectChildList.h"36 35 #include "RenderStyle.h" 37 36 #include "ScrollBehavior.h" … … 148 147 friend class RenderBlock; 149 148 friend class RenderBlockFlow; 149 friend class RenderElement; 150 150 friend class RenderLayer; 151 friend class RenderObjectChildList;152 151 public: 153 152 // Anonymous objects should pass the document as their node, and they will then automatically be … … 167 166 168 167 // 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; } 188 171 189 172 RenderObject* nextInPreOrder() const; … … 271 254 // RenderObject tree manipulation 272 255 ////////////////////////////////////////// 273 virtual bool canHaveChildren() const { return children(); }256 virtual bool canHaveChildren() const = 0; 274 257 virtual bool canHaveGeneratedChildren() const; 275 258 virtual bool createsAnonymousWrapper() const { return false; } -
trunk/Source/WebCore/rendering/RenderReplaced.h
r156262 r156278 73 73 virtual const char* renderName() const OVERRIDE { return "RenderReplaced"; } 74 74 75 virtual bool canHaveChildren() const { return false; }75 virtual bool canHaveChildren() const OVERRIDE { return false; } 76 76 77 77 virtual void computePreferredLogicalWidths() OVERRIDE FINAL; -
trunk/Source/WebCore/rendering/RenderReplica.h
r156262 r156278 51 51 RenderReplica(); 52 52 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; 55 56 56 57 }; -
trunk/Source/WebCore/rendering/RenderRubyBase.cpp
r156262 r156278 99 99 else { 100 100 toBlock = toBase->createAnonymousBlock(); 101 toBase-> children()->appendChildNode(toBase, toBlock);101 toBase->insertChildInternal(toBlock, nullptr, NotifyChildren); 102 102 } 103 103 } … … 124 124 RenderBlock* anonBlockHere = toRenderBlock(firstChildHere); 125 125 RenderBlock* anonBlockThere = toRenderBlock(lastChildThere); 126 anonBlockHere->moveAllChildrenTo(anonBlockThere, anonBlockThere->children());126 anonBlockHere->moveAllChildrenTo(anonBlockThere, true); 127 127 anonBlockHere->deleteLineBoxTree(); 128 128 anonBlockHere->destroy(); -
trunk/Source/WebCore/rendering/RenderTableCol.h
r156262 r156278 38 38 explicit RenderTableCol(Element&); 39 39 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; }46 40 47 41 void clearPreferredLogicalWidthsDirtyBits(); … … 98 92 RenderTable* table() const; 99 93 100 RenderObjectChildList m_children;101 94 unsigned m_span; 102 95 }; -
trunk/Source/WebCore/rendering/RenderTableRow.h
r156262 r156278 36 36 public: 37 37 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; }44 38 45 39 RenderTableSection* section() const { return toRenderTableSection(parent()); } … … 96 90 virtual bool isTableRow() const OVERRIDE { return true; } 97 91 92 virtual bool canHaveChildren() const OVERRIDE { return true; } 98 93 virtual void willBeRemovedFromTree() OVERRIDE; 99 94 … … 110 105 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE; 111 106 112 RenderObjectChildList m_children;113 107 unsigned m_rowIndex : 31; 114 108 }; -
trunk/Source/WebCore/rendering/RenderTableSection.h
r156262 r156278 66 66 virtual ~RenderTableSection(); 67 67 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 74 68 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE; 75 69 … … 205 199 virtual const char* renderName() const OVERRIDE { return (isAnonymous() || isPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; } 206 200 201 virtual bool canHaveChildren() const OVERRIDE { return true; } 202 207 203 virtual bool isTableSection() const OVERRIDE { return true; } 208 204 … … 242 238 243 239 void setLogicalPositionForCell(RenderTableCell*, unsigned effectiveColumn) const; 244 245 RenderObjectChildList m_children;246 240 247 241 Vector<RowStruct> m_grid; -
trunk/Source/WebCore/rendering/RenderText.h
r156262 r156278 159 159 160 160 private: 161 virtual bool canHaveChildren() const OVERRIDE FINAL { return false; } 162 161 163 void computePreferredLogicalWidths(float leadWidth, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow&); 162 164 -
trunk/Source/WebCore/rendering/RenderingAllInOne.cpp
r156262 r156278 85 85 #include "RenderMultiColumnSet.cpp" 86 86 #include "RenderObject.cpp" 87 #include "RenderObjectChildList.cpp"88 87 #include "RenderProgress.cpp" 89 88 #include "RenderQuote.cpp" -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r156262 r156278 140 140 141 141 // Destroy our current children 142 children()->destroyLeftoverChildren();142 destroyLeftoverChildren(); 143 143 144 144 // 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 36 36 virtual ~RenderSVGContainer(); 37 37 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 44 38 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 45 39 virtual void setNeedsBoundariesUpdate() OVERRIDE FINAL { m_needsBoundariesUpdate = true; } … … 53 47 virtual bool isSVGContainer() const OVERRIDE FINAL { return true; } 54 48 virtual const char* renderName() const OVERRIDE { return "RenderSVGContainer"; } 49 50 virtual bool canHaveChildren() const OVERRIDE FINAL { return true; } 55 51 56 52 virtual void layout() OVERRIDE; … … 80 76 81 77 private: 82 RenderObjectChildList m_children;83 78 FloatRect m_objectBoundingBox; 84 79 bool m_objectBoundingBoxValid; -
trunk/Source/WebCore/rendering/svg/RenderSVGGradientStop.h
r156262 r156278 54 54 55 55 private: 56 virtual bool canHaveChildren() const OVERRIDE { return false; } 57 56 58 SVGGradientElement* gradientElement() const; 57 59 }; -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.h
r156262 r156278 60 60 virtual const char* renderName() const { return "RenderSVGImage"; } 61 61 virtual bool isSVGImage() const OVERRIDE { return true; } 62 virtual bool canHaveChildren() const OVERRIDE { return false; } 62 63 63 64 virtual const AffineTransform& localToParentTransform() const { return m_localTransform; } -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r156262 r156278 96 96 { 97 97 SVGResourcesCache::clientDestroyed(this); 98 Render Object::willBeDestroyed();98 RenderElement::willBeDestroyed(); 99 99 } 100 100 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r156262 r156278 46 46 47 47 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; }54 48 55 49 bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } … … 116 110 void buildLocalToBorderBoxTransform(); 117 111 118 RenderObjectChildList m_children;119 112 IntSize m_containerSize; 120 113 FloatRect m_objectBoundingBox; -
trunk/Source/WebCore/rendering/svg/RenderSVGShape.h
r156262 r156278 116 116 117 117 virtual bool isSVGShape() const OVERRIDE FINAL { return true; } 118 virtual bool canHaveChildren() const OVERRIDE FINAL { return false; } 118 119 virtual const char* renderName() const { return "RenderSVGShape"; } 119 120
Note:
See TracChangeset
for help on using the changeset viewer.