Changeset 156285 in webkit
- Timestamp:
- Sep 23, 2013, 12:32:15 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156282 r156285 1 2013-09-23 Antti Koivisto <antti@apple.com> 2 3 Rename RenderObject::first/lastChild to RenderObject::first/lastChildSlow 4 https://bugs.webkit.org/show_bug.cgi?id=121784 5 6 Reviewed by Andreas Kling. 7 8 This will make it obvious in code where typing should be tightened. 9 Handled some simple cases by tightening the code instead of renaming. 10 1 11 2013-09-23 ChangSeok Oh <changseok.oh@collabora.com> 2 12 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r155955 r156285 759 759 for (RenderObject* r = renderer->previousInPreOrder(); r; r = r->previousInPreOrder()) { 760 760 // skip non-leaf nodes 761 if (r->firstChild ())761 if (r->firstChildSlow()) 762 762 continue; 763 763 … … 782 782 for (RenderObject* r = renderer->nextInPreOrder(); r; r = r->nextInPreOrder()) { 783 783 // skip non-leaf nodes 784 if (r->firstChild ())784 if (r->firstChildSlow()) 785 785 continue; 786 786 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r156251 r156285 177 177 if (r->isRenderBlock()) 178 178 return r; 179 if (RenderObject* child = r->firstChild ())179 if (RenderObject* child = r->firstChildSlow()) 180 180 return child; 181 181 r = toRenderInline(r)->continuation(); … … 187 187 static inline RenderObject* firstChildConsideringContinuation(RenderObject* renderer) 188 188 { 189 RenderObject* firstChild = renderer->firstChild ();189 RenderObject* firstChild = renderer->firstChildSlow(); 190 190 191 191 if (!firstChild && isInlineWithContinuation(renderer)) … … 198 198 static inline RenderObject* lastChildConsideringContinuation(RenderObject* renderer) 199 199 { 200 RenderObject* lastChild = renderer->lastChild ();200 RenderObject* lastChild = renderer->lastChildSlow(); 201 201 RenderObject* prev; 202 202 RenderObject* cur = renderer; … … 208 208 prev = cur; 209 209 210 if (RenderObject* lc = cur->lastChild ())210 if (RenderObject* lc = cur->lastChildSlow()) 211 211 lastChild = lc; 212 212 … … 326 326 static inline bool firstChildIsInlineContinuation(RenderObject* renderer) 327 327 { 328 return renderer->firstChild() && renderer->firstChild()->isInlineElementContinuation(); 328 RenderObject* child = renderer->firstChildSlow(); 329 return child && child->isInlineElementContinuation(); 329 330 } 330 331 … … 345 346 // the parent of the start, since everything in between will be linked up via the continuation. 346 347 else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) { 347 RenderObject* firstParent = startOfContinuations(m_renderer->firstChild ())->parent();348 RenderObject* firstParent = startOfContinuations(m_renderer->firstChildSlow())->parent(); 348 349 while (firstChildIsInlineContinuation(firstParent)) 349 firstParent = startOfContinuations(firstParent->firstChild ())->parent();350 firstParent = startOfContinuations(firstParent->firstChildSlow())->parent(); 350 351 previousSibling = firstParent->previousSibling(); 351 352 } … … 368 369 static inline bool lastChildHasContinuation(RenderObject* renderer) 369 370 { 370 return renderer->lastChild() && isInlineWithContinuation(renderer->lastChild()); 371 RenderObject* child = renderer->lastChildSlow(); 372 return child && isInlineWithContinuation(child); 371 373 } 372 374 … … 387 389 // after the parent of the end, since everything in between will be linked up via the continuation. 388 390 else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) { 389 RenderObject* lastParent = endOfContinuations(m_renderer->lastChild ())->parent();391 RenderObject* lastParent = endOfContinuations(m_renderer->lastChildSlow())->parent(); 390 392 while (lastChildHasContinuation(lastParent)) 391 lastParent = endOfContinuations(lastParent->lastChild ())->parent();393 lastParent = endOfContinuations(lastParent->lastChildSlow())->parent(); 392 394 nextSibling = lastParent->nextSibling(); 393 395 } … … 450 452 451 453 // Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation. 452 else if (parent && (firstChild = parent->firstChild ()) && firstChild->node()) {454 else if (parent && (firstChild = parent->firstChildSlow()) && firstChild->node()) { 453 455 // Get the node's renderer and follow that continuation chain until the first child is found 454 456 RenderObject* nodeRenderFirstChild = firstChild->node()->renderer(); … … 460 462 } 461 463 } 462 if (firstChild == parent->firstChild()) 464 RenderObject* parentFirstChild = parent->firstChildSlow(); 465 if (firstChild == parentFirstChild) 463 466 break; 464 firstChild = parent ->firstChild();467 firstChild = parentFirstChild; 465 468 if (!firstChild->node()) 466 469 break; … … 3364 3367 RenderObject* renderer = node()->renderer(); 3365 3368 while (renderer && !renderer->isText()) 3366 renderer = renderer->firstChild();3369 renderer = toRenderElement(renderer)->firstChild(); 3367 3370 3368 3371 if (!renderer || !renderer->isText()) -
trunk/Source/WebCore/dom/ContainerNode.cpp
r156256 r156285 895 895 while (o) { 896 896 p = o; 897 if ( o->firstChild())898 o = o->firstChild();897 if (RenderObject* child = o->firstChildSlow()) 898 o = child; 899 899 else if (o->nextSibling()) 900 900 o = o->nextSibling(); … … 955 955 // find the last text/image child, to get a position 956 956 while (o) { 957 if ( o->lastChild())958 o = o->lastChild();957 if (RenderObject* child = o->lastChildSlow()) 958 o = child; 959 959 else if (o->previousSibling()) 960 960 o = o->previousSibling(); -
trunk/Source/WebCore/dom/Position.cpp
r156054 r156285 855 855 { 856 856 RenderObject* stop = renderer->nextInPreOrderAfterChildren(); 857 for (RenderObject *o = renderer->firstChild (); o && o != stop; o = o->nextInPreOrder())857 for (RenderObject *o = renderer->firstChildSlow(); o && o != stop; o = o->nextInPreOrder()) 858 858 if (o->nonPseudoNode()) { 859 859 if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox())) … … 1135 1135 static bool isNonTextLeafChild(RenderObject* object) 1136 1136 { 1137 if (object->firstChild())1138 return false;1139 1137 if (object->isText()) 1138 return false; 1139 if (toRenderElement(object)->firstChild()) 1140 1140 return false; 1141 1141 return true; -
trunk/Source/WebCore/editing/TextIterator.cpp
r156038 r156285 643 643 644 644 // FIXME: Should this check descendent objects? 645 for (RenderObject* current = firstLetter->firstChild (); current; current = current->nextSibling()) {645 for (RenderObject* current = firstLetter->firstChildSlow(); current; current = current->nextSibling()) { 646 646 if (current->isText()) 647 647 return toRenderText(current); -
trunk/Source/WebCore/editing/htmlediting.cpp
r156151 r156285 897 897 898 898 // Check that the table cell contains no child renderers except for perhaps a single <br>. 899 RenderObject* childRenderer = renderer->firstChild();899 RenderObject* childRenderer = toRenderElement(renderer)->firstChild(); 900 900 if (!childRenderer) 901 901 return true; -
trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
r156151 r156285 145 145 } 146 146 147 for (renderer = renderer->firstChild (); renderer; renderer = renderer->nextSibling())147 for (renderer = renderer->firstChildSlow(); renderer; renderer = renderer->nextSibling()) 148 148 gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers); 149 149 } -
trunk/Source/WebCore/plugins/IFrameShimSupport.cpp
r155507 r156285 103 103 ASSERT(parent == ro2->parent()); 104 104 105 for (const RenderObject* ro = parent->firstChild (); ro; ro = ro->nextSibling()) {105 for (const RenderObject* ro = parent->firstChildSlow(); ro; ro = ro->nextSibling()) { 106 106 if (ro == ro1) 107 107 return false; -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r143762 r156285 138 138 139 139 RenderObject* firstRow = section->firstChild(); 140 for (RenderObject* child = firstRow->firstChild (); child; child = child->nextSibling()) {140 for (RenderObject* child = firstRow->firstChildSlow(); child; child = child->nextSibling()) { 141 141 if (!child->isTableCell()) 142 142 continue; -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r156094 r156285 269 269 } 270 270 271 static inline bool isLastChildForRenderer(Render Object* ancestor, RenderObject* child)271 static inline bool isLastChildForRenderer(RenderElement* ancestor, RenderObject* child) 272 272 { 273 273 if (!child) … … 278 278 279 279 RenderObject* curr = child; 280 Render Object* parent = curr->parent();280 RenderElement* parent = curr->parent(); 281 281 while (parent && (!parent->isRenderBlock() || parent->isInline())) { 282 282 if (parent->lastChild() != curr) -
trunk/Source/WebCore/rendering/InlineIterator.h
r156039 r156285 181 181 return false; 182 182 183 for (RenderObject* curr = object->firstChild(); curr; curr = curr->nextSibling()) {183 for (RenderObject* curr = toRenderElement(object)->firstChild(); curr; curr = curr->nextSibling()) { 184 184 if (curr->isFloatingOrOutOfFlowPositioned()) 185 185 continue; … … 207 207 next = 0; 208 208 if (!oldEndOfInline && !isIteratorTarget(current)) { 209 next = current->firstChild();209 next = toRenderElement(current)->firstChild(); 210 210 notifyObserverEnteredObject(observer, next); 211 211 } … … 274 274 } 275 275 276 static inline RenderObject* bidiFirstSkippingEmptyInlines(Render Object* root, InlineBidiResolver* resolver = 0)276 static inline RenderObject* bidiFirstSkippingEmptyInlines(RenderElement* root, InlineBidiResolver* resolver = 0) 277 277 { 278 278 RenderObject* o = root->firstChild(); … … 302 302 303 303 // FIXME: This method needs to be renamed when bidiNext finds a good name. 304 static inline RenderObject* bidiFirstIncludingEmptyInlines(Render Object* root)304 static inline RenderObject* bidiFirstIncludingEmptyInlines(RenderElement* root) 305 305 { 306 306 RenderObject* o = root->firstChild(); … … 325 325 class InlineWalker { 326 326 public: 327 InlineWalker(Render Object* root)327 InlineWalker(RenderElement* root) 328 328 : m_root(root) 329 329 , m_current(0) … … 334 334 } 335 335 336 Render Object* root() { return m_root; }336 RenderElement* root() { return m_root; } 337 337 RenderObject* current() { return m_current; } 338 338 … … 347 347 } 348 348 private: 349 Render Object* m_root;349 RenderElement* m_root; 350 350 RenderObject* m_current; 351 351 bool m_atEndOfInline; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r156278 r156285 1079 1079 1080 1080 // FIXME: This check isn't required when inline run-ins can't be split into continuations. 1081 if (prev && prev->firstChild() && prev->firstChild()->isInline() && prev->firstChild()->isRunIn()) 1081 RenderObject* child = prev ? prev->firstChildSlow() : nullptr; 1082 if (child && child->isInline() && child->isRunIn()) 1082 1083 return false; 1083 1084 … … 5081 5082 (current == parent || 5082 5083 (!current->isFloating() && !current->isReplaced() && !current->isOutOfFlowPositioned()))) 5083 result = current->firstChild ();5084 result = current->firstChildSlow(); 5084 5085 if (!result) { 5085 5086 // We hit the end of our inline. (It was empty, e.g., <span></span>.) … … 5746 5747 // of flexbox. 5747 5748 if (firstLineBlock->isReplaced() || firstLineBlock->isFloating() 5748 || !parentBlock || parentBlock->firstChild () != firstLineBlock || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton()))5749 || !parentBlock || parentBlock->firstChildSlow() != firstLineBlock || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton())) 5749 5750 break; 5750 5751 ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isRenderBlock()); … … 5786 5787 } 5787 5788 5788 static inline Render Object* findFirstLetterBlock(RenderBlock* start)5789 { 5790 Render Object* firstLetterBlock = start;5789 static inline RenderElement* findFirstLetterBlock(RenderBlock* start) 5790 { 5791 RenderElement* firstLetterBlock = start; 5791 5792 while (true) { 5792 5793 // We include isRenderButton in these two checks because buttons are … … 5802 5803 return firstLetterBlock; 5803 5804 5804 Render Object* parentBlock = firstLetterBlock->parent();5805 if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock ||5806 (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton()))5805 RenderElement* parentBlock = firstLetterBlock->parent(); 5806 if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock 5807 || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton())) 5807 5808 return 0; 5808 5809 firstLetterBlock = parentBlock; … … 5945 5946 5946 5947 // Drill into inlines looking for our first text child. 5947 RenderObject* currChild = firstLetterBlock->firstChild ();5948 RenderObject* currChild = firstLetterBlock->firstChildSlow(); 5948 5949 while (currChild) { 5949 5950 if (currChild->isText()) … … 5953 5954 else if (currChild->isFloatingOrOutOfFlowPositioned()) { 5954 5955 if (currChild->style()->styleType() == FIRST_LETTER) { 5955 currChild = currChild->firstChild ();5956 currChild = currChild->firstChildSlow(); 5956 5957 break; 5957 5958 } … … 5962 5963 // We found a lower-level node with first-letter, which supersedes the higher-level style 5963 5964 firstLetterBlock = currChild; 5964 currChild = currChild->firstChild ();5965 currChild = currChild->firstChildSlow(); 5965 5966 } else 5966 currChild = currChild->firstChild ();5967 currChild = currChild->firstChildSlow(); 5967 5968 } 5968 5969 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r156278 r156285 4083 4083 4084 4084 for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject->nextSibling()) { 4085 if ((!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isRenderBlockFlow() )4086 || renderObject->style()->visibility() != VISIBLE)4087 continue;4088 4089 4085 if (!renderObject->isBox()) 4090 4086 continue; 4091 4092 4087 RenderBox* renderer = toRenderBox(renderObject); 4088 4089 if ((!renderer->firstChild() && !renderer->isInline() && !renderer->isRenderBlockFlow() ) 4090 || renderer->style()->visibility() != VISIBLE) 4091 continue; 4093 4092 4094 4093 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? LayoutUnit() : renderer->y()); -
trunk/Source/WebCore/rendering/RenderElement.cpp
r156278 r156285 327 327 } 328 328 329 static void addLayers(Render Object* obj, RenderLayer* parentLayer, RenderElement*& newObject, RenderLayer*& beforeChild)329 static void addLayers(RenderElement* obj, RenderLayer* parentLayer, RenderElement*& newObject, RenderLayer*& beforeChild) 330 330 { 331 331 if (obj->hasLayer()) { … … 341 341 } 342 342 343 for (RenderObject* curr = obj->firstChild(); curr; curr = curr->nextSibling()) 344 addLayers(curr, parentLayer, newObject, beforeChild); 343 for (RenderObject* current = obj->firstChild(); current; current = current->nextSibling()) { 344 if (current->isRenderElement()) 345 addLayers(toRenderElement(current), parentLayer, newObject, beforeChild); 346 } 345 347 } 346 348 -
trunk/Source/WebCore/rendering/RenderElement.h
r156278 r156285 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; }41 RenderObject* firstChild() const { return m_firstChild; } 42 RenderObject* lastChild() const { return m_lastChild; } 43 43 44 44 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true; } … … 80 80 void generatingNode() const WTF_DELETED_FUNCTION; 81 81 void isText() const WTF_DELETED_FUNCTION; 82 void isRenderElement() const WTF_DELETED_FUNCTION; 83 84 virtual RenderObject* firstChildSlow() const { return firstChild(); } 85 virtual RenderObject* lastChildSlow() const { return lastChild(); } 82 86 83 87 RenderObject* m_firstChild; -
trunk/Source/WebCore/rendering/RenderFrameBase.cpp
r155806 r156285 97 97 ASSERT(!childFrameView->layoutPending()); 98 98 ASSERT(!childRoot->needsLayout()); 99 ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild () || !childRoot->firstChild()->firstChild()->needsLayout());99 ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChildSlow() || !childRoot->firstChild()->firstChildSlow()->needsLayout()); 100 100 101 101 setNeedsLayout(false); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r156223 r156285 1139 1139 break; 1140 1140 } 1141 if (r->firstChild() && !r->hasLayer()) 1142 r = r->firstChild(); 1141 RenderObject* child; 1142 if (!r->hasLayer() && (child = r->firstChildSlow())) 1143 r = child; 1143 1144 else if (r->nextSibling()) 1144 1145 r = r->nextSibling(); -
trunk/Source/WebCore/rendering/RenderListItem.cpp
r156155 r156285 261 261 } 262 262 263 static RenderObject* firstNonMarkerChild(Render Object* parent)263 static RenderObject* firstNonMarkerChild(RenderBlock* parent) 264 264 { 265 265 RenderObject* result = parent->firstChild(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r156278 r156285 216 216 setFlowThreadState(state); 217 217 218 for (RenderObject* child = firstChild (); child; child = child->nextSibling()) {218 for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) { 219 219 // If the child is a fragmentation context it already updated the descendants flag accordingly. 220 220 if (child->isRenderFlowThread()) … … 245 245 RenderObject* RenderObject::nextInPreOrder() const 246 246 { 247 if (RenderObject* o = firstChild ())247 if (RenderObject* o = firstChildSlow()) 248 248 return o; 249 249 … … 267 267 RenderObject* RenderObject::nextInPreOrder(const RenderObject* stayWithin) const 268 268 { 269 if (RenderObject* o = firstChild ())269 if (RenderObject* o = firstChildSlow()) 270 270 return o; 271 271 … … 291 291 { 292 292 if (RenderObject* o = previousSibling()) { 293 while ( o->lastChild())294 o = o->lastChild();293 while (RenderObject* last = o->lastChildSlow()) 294 o = last; 295 295 return o; 296 296 } … … 309 309 RenderObject* RenderObject::childAt(unsigned index) const 310 310 { 311 RenderObject* child = firstChild ();311 RenderObject* child = firstChildSlow(); 312 312 for (unsigned i = 0; child && i < index; i++) 313 313 child = child->nextSibling(); … … 317 317 RenderObject* RenderObject::firstLeafChild() const 318 318 { 319 RenderObject* r = firstChild ();319 RenderObject* r = firstChildSlow(); 320 320 while (r) { 321 321 RenderObject* n = 0; 322 n = r->firstChild ();322 n = r->firstChildSlow(); 323 323 if (!n) 324 324 break; … … 330 330 RenderObject* RenderObject::lastLeafChild() const 331 331 { 332 RenderObject* r = lastChild ();332 RenderObject* r = lastChildSlow(); 333 333 while (r) { 334 334 RenderObject* n = 0; 335 n = r->lastChild ();335 n = r->lastChildSlow(); 336 336 if (!n) 337 337 break; … … 1229 1229 if (hasLayer()) 1230 1230 result.unite(absoluteBoundingBoxRectIgnoringTransforms()); 1231 for (RenderObject* current = firstChild (); current; current = current->nextSibling())1231 for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling()) 1232 1232 current->addAbsoluteRectForLayer(result); 1233 1233 } … … 1238 1238 LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms(); 1239 1239 topLevelRect = result; 1240 for (RenderObject* current = firstChild (); current; current = current->nextSibling())1240 for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling()) 1241 1241 current->addAbsoluteRectForLayer(result); 1242 1242 return result; … … 1592 1592 return; 1593 1593 1594 for (const RenderObject* child = firstChild (); child; child = child->nextSibling())1594 for (const RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) 1595 1595 child->showRenderTreeAndMark(markedObject1, markedLabel1, markedObject2, markedLabel2, depth + 1); 1596 1596 } … … 1780 1780 inline bool RenderObject::hasImmediateNonWhitespaceTextChild() const 1781 1781 { 1782 for (const RenderObject* r = firstChild(); r; r = r->nextSibling()) { 1782 if (isText()) 1783 return false; 1784 for (const RenderObject* r = toRenderElement(this)->firstChild(); r; r = r->nextSibling()) { 1783 1785 if (r->isText() && !toRenderText(r)->isAllCollapsibleWhitespace()) 1784 1786 return true; … … 2016 2018 { 2017 2019 // FIXME: We could save this call when the change only affected non-inherited properties. 2018 for (RenderObject* child = firstChild (); child; child = child->nextSibling()) {2020 for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) { 2019 2021 if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO) 2020 2022 continue; … … 2516 2518 void RenderObject::removeFromRenderFlowThreadRecursive(RenderFlowThread* renderFlowThread) 2517 2519 { 2518 for (RenderObject* child = firstChild (); child; child = child->nextSibling())2520 for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) 2519 2521 child->removeFromRenderFlowThreadRecursive(renderFlowThread); 2520 2522 … … 2536 2538 2537 2539 RenderObject* destroyRoot = this; 2538 for (Render Object* destroyRootParent = destroyRoot->parent(); destroyRootParent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destroyRootParent = destroyRootParent->parent()) {2540 for (RenderElement* destroyRootParent = destroyRoot->parent(); destroyRootParent && destroyRootParent->isAnonymous(); destroyRoot = destroyRootParent, destroyRootParent = destroyRootParent->parent()) { 2539 2541 // Currently we only remove anonymous cells' and table sections' wrappers but we should remove all unneeded 2540 2542 // wrappers. See http://webkit.org/b/52123 as an example where this is needed. … … 2615 2617 if (valueChanged && node() && (style()->affectedByDrag() || (node()->isElementNode() && toElement(node())->childrenAffectedByDrag()))) 2616 2618 node()->setNeedsStyleRecalc(); 2617 for (RenderObject* curr = firstChild (); curr; curr = curr->nextSibling())2619 for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling()) 2618 2620 curr->updateDragState(dragOn); 2619 2621 } … … 2688 2690 StackStats::LayoutCheckPoint layoutCheckPoint; 2689 2691 ASSERT(needsLayout()); 2690 RenderObject* child = firstChild ();2692 RenderObject* child = firstChildSlow(); 2691 2693 while (child) { 2692 2694 child->layoutIfNeeded(); … … 2913 2915 2914 2916 addAnnotatedRegions(regions); 2915 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())2917 for (RenderObject* curr = toRenderElement(this)->firstChild(); curr; curr = curr->nextSibling()) 2916 2918 curr->collectAnnotatedRegions(regions); 2917 2919 } -
trunk/Source/WebCore/rendering/RenderObject.h
r156278 r156285 165 165 RenderObject* nextSibling() const { return m_next; } 166 166 167 // FIXME: These should be renamed slowFirstChild, slowLastChild, etc. 168 // to discourage their use. 169 virtual RenderObject* firstChild() const { return nullptr; } 170 virtual RenderObject* lastChild() const { return nullptr; } 167 // Use RenderElement versions instead. 168 virtual RenderObject* firstChildSlow() const { return nullptr; } 169 virtual RenderObject* lastChildSlow() const { return nullptr; } 171 170 172 171 RenderObject* nextInPreOrder() const; … … 225 224 RenderNamedFlowThread* renderNamedFlowThreadWrapper() const; 226 225 227 virtual bool isEmpty() const { return firstChild() == 0; } 226 // FIXME: The meaning of this function is unclear. 227 virtual bool isEmpty() const { return !firstChildSlow(); } 228 228 229 229 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r156250 r156285 581 581 void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object) 582 582 { 583 for (RenderObject* child = object->firstChild (); child; child = child->nextSibling()) {583 for (RenderObject* child = object->firstChildSlow(); child; child = child->nextSibling()) { 584 584 585 585 RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find(child); … … 633 633 634 634 // Clear the style for the children of this object. 635 for (RenderObject* child = object->firstChild (); child; child = child->nextSibling())635 for (RenderObject* child = object->firstChildSlow(); child; child = child->nextSibling()) 636 636 clearObjectStyleInRegion(child); 637 637 } -
trunk/Source/WebCore/rendering/RenderRuby.cpp
r156151 r156285 60 60 return isAnonymousRubyInlineBlock(object) 61 61 && !object->previousSibling() 62 && object->firstChild ()63 && object->firstChild ()->style()->styleType() == BEFORE;62 && object->firstChildSlow() 63 && object->firstChildSlow()->style()->styleType() == BEFORE; 64 64 } 65 65 … … 68 68 return isAnonymousRubyInlineBlock(object) 69 69 && !object->nextSibling() 70 && object->firstChild ()71 && object->firstChild ()->style()->styleType() == AFTER;70 && object->firstChildSlow() 71 && object->firstChildSlow()->style()->styleType() == AFTER; 72 72 } 73 73 74 74 static inline RenderBlock* rubyBeforeBlock(const RenderObject* ruby) 75 75 { 76 RenderObject* child = ruby->firstChild ();76 RenderObject* child = ruby->firstChildSlow(); 77 77 return isRubyBeforeBlock(child) ? toRenderBlock(child) : 0; 78 78 } … … 80 80 static inline RenderBlock* rubyAfterBlock(const RenderObject* ruby) 81 81 { 82 RenderObject* child = ruby->lastChild ();82 RenderObject* child = ruby->lastChildSlow(); 83 83 return isRubyAfterBlock(child) ? toRenderBlock(child) : 0; 84 84 } … … 94 94 static RenderRubyRun* lastRubyRun(const RenderObject* ruby) 95 95 { 96 RenderObject* child = ruby->lastChild ();96 RenderObject* child = ruby->lastChildSlow(); 97 97 if (child && !child->isRubyRun()) 98 98 child = child->previousSibling(); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r156166 r156285 185 185 lastBox = lastBox->parent(); 186 186 if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox)) { 187 if (beforeChild == lastBox) 188 beforeChild = lastBox->firstChild(); 189 toRenderTableSection(lastBox)->addChild(child, beforeChild); 187 RenderTableSection* section = toRenderTableSection(lastBox); 188 if (beforeChild == section) 189 beforeChild = section->firstChild(); 190 section->addChild(child, beforeChild); 190 191 return; 191 192 } … … 569 570 if (!section->isTableSection()) 570 571 continue; 571 for (RenderObject* row = section->firstChild(); row; row = row->nextSibling()) {572 for (RenderObject* row = toRenderTableSection(section)->firstChild(); row; row = row->nextSibling()) { 572 573 if (!row->isTableRow()) 573 574 continue; 574 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {575 for (RenderObject* cell = toRenderTableRow(row)->firstChild(); cell; cell = cell->nextSibling()) { 575 576 if (!cell->isTableCell()) 576 577 continue; -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r156151 r156285 112 112 last = lastChild(); 113 113 if (last && last->isAnonymous() && last->isTableCell() && !last->isBeforeOrAfterContent()) { 114 if (beforeChild == last) 115 beforeChild = last->firstChild(); 116 toRenderTableCell(last)->addChild(child, beforeChild); 114 RenderTableCell* cell = toRenderTableCell(last); 115 if (beforeChild == cell) 116 beforeChild = cell->firstChild(); 117 cell->addChild(child, beforeChild); 117 118 return; 118 119 } -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r156166 r156285 131 131 last = lastChild(); 132 132 if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) { 133 if (beforeChild == last) 134 beforeChild = last->firstChild(); 135 toRenderTableRow(last)->addChild(child, beforeChild); 133 RenderTableRow* row = toRenderTableRow(last); 134 if (beforeChild == row) 135 beforeChild = row->firstChild(); 136 row->addChild(child, beforeChild); 136 137 return; 137 138 } … … 1235 1236 setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(m_grid[insertionRow]); 1236 1237 1237 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {1238 for (RenderObject* cell = tableRow->firstChild(); cell; cell = cell->nextSibling()) { 1238 1239 if (!cell->isTableCell()) 1239 1240 continue; -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r156054 r156285 598 598 } 599 599 600 for (RenderObject* child = o.firstChild (); child; child = child->nextSibling()) {600 for (RenderObject* child = o.firstChildSlow(); child; child = child->nextSibling()) { 601 601 if (child->hasLayer()) 602 602 continue; … … 919 919 if (!parent) 920 920 return; 921 for (RenderObject* child = parent->firstChild (); child; child = child->nextSibling()) {921 for (RenderObject* child = parent->firstChildSlow(); child; child = child->nextSibling()) { 922 922 if (child->isCounter()) { 923 923 if (!isFirstCounter) -
trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
r156151 r156285 124 124 if (!numeratorWrapper) 125 125 return 0; 126 RenderObject* numerator = numeratorWrapper->firstChild ();126 RenderObject* numerator = numeratorWrapper->firstChildSlow(); 127 127 if (!numerator || !numerator->isRenderMathMLBlock()) 128 128 return 0; -
trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp
r155756 r156285 141 141 ASSERT(locateElement); 142 142 // FIXME: Make this iterative. 143 for (RenderObject* child = start->firstChild (); child; child = child->nextSibling()) {143 for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) { 144 144 if (child->isSVGInlineText()) { 145 145 RenderSVGInlineText* text = toRenderSVGInlineText(child); -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
r154462 r156285 146 146 } 147 147 148 void SVGRenderSupport::computeContainerBoundingBoxes(const Render Object* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox)148 void SVGRenderSupport::computeContainerBoundingBoxes(const RenderElement* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox) 149 149 { 150 150 objectBoundingBox = FloatRect(); … … 196 196 resources->removeClientFromCache(start, false); 197 197 198 for (RenderObject* child = start->firstChild (); child; child = child->nextSibling())198 for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) 199 199 invalidateResourcesOfChildren(child); 200 200 } … … 234 234 HashSet<RenderObject*> notlayoutedObjects; 235 235 236 for (RenderObject* child = start->firstChild (); child; child = child->nextSibling()) {236 for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) { 237 237 bool needsLayout = selfNeedsLayout; 238 238 bool childEverHadLayout = child->everHadLayout(); -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.h
r137847 r156285 35 35 class LayoutRect; 36 36 class RenderBoxModelObject; 37 class RenderElement; 37 38 class RenderGeometryMap; 38 39 class RenderLayerModelObject; … … 62 63 static bool pointInClippingArea(RenderObject*, const FloatPoint&); 63 64 64 static void computeContainerBoundingBoxes(const Render Object* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox);65 static void computeContainerBoundingBoxes(const RenderElement* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox); 65 66 static bool paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo&); 66 67 -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r156102 r156285 467 467 static void writeChildren(TextStream& ts, const RenderObject& object, int indent) 468 468 { 469 for (RenderObject* child = object.firstChild (); child; child = child->nextSibling())469 for (RenderObject* child = object.firstChildSlow(); child; child = child->nextSibling()) 470 470 write(ts, *child, indent + 1); 471 471 } -
trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp
r95901 r156285 71 71 // <marker id="a"> <path marker-start="url(#b)"/> ... 72 72 // <marker id="b"> <path marker-start="url(#a)"/> ... 73 for (RenderObject* child = renderer->firstChild (); child; child = child->nextSibling()) {73 for (RenderObject* child = renderer->firstChildSlow(); child; child = child->nextSibling()) { 74 74 SVGResources* childResources = SVGResourcesCache::cachedResourcesForRenderObject(child); 75 75 if (!childResources) -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
r130612 r156285 107 107 ASSERT(!start->isSVGText() || m_textPositions.isEmpty()); 108 108 109 for (RenderObject* child = start->firstChild (); child; child = child->nextSibling()) {109 for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) { 110 110 if (child->isSVGInlineText()) { 111 111 processRenderSVGInlineText(toRenderSVGInlineText(child), m_textLength, lastCharacter); -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r138316 r156285 180 180 void SVGTextMetricsBuilder::walkTree(RenderObject* start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data) 181 181 { 182 for (RenderObject* child = start->firstChild (); child; child = child->nextSibling()) {182 for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) { 183 183 if (child->isSVGInlineText()) { 184 184 RenderSVGInlineText* text = toRenderSVGInlineText(child); -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r156250 r156285 341 341 return false; 342 342 343 RenderObject* first = parentRenderer.firstChild ();343 RenderObject* first = parentRenderer.firstChildSlow(); 344 344 while (first && first->isFloatingOrOutOfFlowPositioned()) 345 345 first = first->nextSibling(); -
trunk/Source/WebKit/mac/WebView/WebRenderNode.mm
r154449 r156285 87 87 { 88 88 NSMutableArray *children = [[NSMutableArray alloc] init]; 89 for (RenderObject* child = node->firstChild (); child; child = child->nextSibling()) {89 for (RenderObject* child = node->firstChildSlow(); child; child = child->nextSibling()) { 90 90 WebRenderNode *childCopy = copyRenderNode(child); 91 91 [children addObject:childCopy]; -
trunk/Source/WebKit2/Shared/WebRenderObject.cpp
r154449 r156285 91 91 92 92 m_children = MutableArray::create(); 93 for (RenderObject* coreChild = renderer->firstChild (); coreChild; coreChild = coreChild->nextSibling()) {93 for (RenderObject* coreChild = renderer->firstChildSlow(); coreChild; coreChild = coreChild->nextSibling()) { 94 94 RefPtr<WebRenderObject> child = adoptRef(new WebRenderObject(coreChild, shouldIncludeDescendants)); 95 95 m_children->append(child.get());
Note:
See TracChangeset
for help on using the changeset viewer.