Changeset 156285 in webkit


Ignore:
Timestamp:
Sep 23, 2013, 12:32:15 PM (12 years ago)
Author:
Antti Koivisto
Message:

Rename RenderObject::first/lastChild to RenderObject::first/lastChildSlow
https://bugs.webkit.org/show_bug.cgi?id=121784

Reviewed by Andreas Kling.

This will make it obvious in code where typing should be tightened.
Handled some simple cases by tightening the code instead of renaming.

Location:
trunk/Source
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156282 r156285  
     12013-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
    1112013-09-23  ChangSeok Oh  <changseok.oh@collabora.com>
    212
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r155955 r156285  
    759759    for (RenderObject* r = renderer->previousInPreOrder(); r; r = r->previousInPreOrder()) {
    760760        // skip non-leaf nodes
    761         if (r->firstChild())
     761        if (r->firstChildSlow())
    762762            continue;
    763763
     
    782782    for (RenderObject* r = renderer->nextInPreOrder(); r; r = r->nextInPreOrder()) {
    783783        // skip non-leaf nodes
    784         if (r->firstChild())
     784        if (r->firstChildSlow())
    785785            continue;
    786786
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r156251 r156285  
    177177        if (r->isRenderBlock())
    178178            return r;
    179         if (RenderObject* child = r->firstChild())
     179        if (RenderObject* child = r->firstChildSlow())
    180180            return child;
    181181        r = toRenderInline(r)->continuation();
     
    187187static inline RenderObject* firstChildConsideringContinuation(RenderObject* renderer)
    188188{
    189     RenderObject* firstChild = renderer->firstChild();
     189    RenderObject* firstChild = renderer->firstChildSlow();
    190190
    191191    if (!firstChild && isInlineWithContinuation(renderer))
     
    198198static inline RenderObject* lastChildConsideringContinuation(RenderObject* renderer)
    199199{
    200     RenderObject* lastChild = renderer->lastChild();
     200    RenderObject* lastChild = renderer->lastChildSlow();
    201201    RenderObject* prev;
    202202    RenderObject* cur = renderer;
     
    208208        prev = cur;
    209209
    210         if (RenderObject* lc = cur->lastChild())
     210        if (RenderObject* lc = cur->lastChildSlow())
    211211            lastChild = lc;
    212212
     
    326326static inline bool firstChildIsInlineContinuation(RenderObject* renderer)
    327327{
    328     return renderer->firstChild() && renderer->firstChild()->isInlineElementContinuation();
     328    RenderObject* child = renderer->firstChildSlow();
     329    return child && child->isInlineElementContinuation();
    329330}
    330331
     
    345346    // the parent of the start, since everything in between will be linked up via the continuation.
    346347    else if (m_renderer->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) {
    347         RenderObject* firstParent = startOfContinuations(m_renderer->firstChild())->parent();
     348        RenderObject* firstParent = startOfContinuations(m_renderer->firstChildSlow())->parent();
    348349        while (firstChildIsInlineContinuation(firstParent))
    349             firstParent = startOfContinuations(firstParent->firstChild())->parent();
     350            firstParent = startOfContinuations(firstParent->firstChildSlow())->parent();
    350351        previousSibling = firstParent->previousSibling();
    351352    }
     
    368369static inline bool lastChildHasContinuation(RenderObject* renderer)
    369370{
    370     return renderer->lastChild() && isInlineWithContinuation(renderer->lastChild());
     371    RenderObject* child = renderer->lastChildSlow();
     372    return child && isInlineWithContinuation(child);
    371373}
    372374
     
    387389    // after the parent of the end, since everything in between will be linked up via the continuation.
    388390    else if (m_renderer->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) {
    389         RenderObject* lastParent = endOfContinuations(m_renderer->lastChild())->parent();
     391        RenderObject* lastParent = endOfContinuations(m_renderer->lastChildSlow())->parent();
    390392        while (lastChildHasContinuation(lastParent))
    391             lastParent = endOfContinuations(lastParent->lastChild())->parent();
     393            lastParent = endOfContinuations(lastParent->lastChildSlow())->parent();
    392394        nextSibling = lastParent->nextSibling();
    393395    }
     
    450452   
    451453    // 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()) {
    453455        // Get the node's renderer and follow that continuation chain until the first child is found
    454456        RenderObject* nodeRenderFirstChild = firstChild->node()->renderer();
     
    460462                }
    461463            }
    462             if (firstChild == parent->firstChild())
     464            RenderObject* parentFirstChild = parent->firstChildSlow();
     465            if (firstChild == parentFirstChild)
    463466                break;
    464             firstChild = parent->firstChild();
     467            firstChild = parentFirstChild;
    465468            if (!firstChild->node())
    466469                break;
     
    33643367    RenderObject* renderer = node()->renderer();
    33653368    while (renderer && !renderer->isText())
    3366         renderer = renderer->firstChild();
     3369        renderer = toRenderElement(renderer)->firstChild();
    33673370
    33683371    if (!renderer || !renderer->isText())
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r156256 r156285  
    895895    while (o) {
    896896        p = o;
    897         if (o->firstChild())
    898             o = o->firstChild();
     897        if (RenderObject* child = o->firstChildSlow())
     898            o = child;
    899899        else if (o->nextSibling())
    900900            o = o->nextSibling();
     
    955955    // find the last text/image child, to get a position
    956956    while (o) {
    957         if (o->lastChild())
    958             o = o->lastChild();
     957        if (RenderObject* child = o->lastChildSlow())
     958            o = child;
    959959        else if (o->previousSibling())
    960960            o = o->previousSibling();
  • trunk/Source/WebCore/dom/Position.cpp

    r156054 r156285  
    855855{
    856856    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())
    858858        if (o->nonPseudoNode()) {
    859859            if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox()))
     
    11351135static bool isNonTextLeafChild(RenderObject* object)
    11361136{
    1137     if (object->firstChild())
    1138         return false;
    11391137    if (object->isText())
     1138        return false;
     1139    if (toRenderElement(object)->firstChild())
    11401140        return false;
    11411141    return true;
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r156038 r156285  
    643643
    644644    // 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()) {
    646646        if (current->isText())
    647647            return toRenderText(current);
  • trunk/Source/WebCore/editing/htmlediting.cpp

    r156151 r156285  
    897897
    898898    // 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();
    900900    if (!childRenderer)
    901901        return true;
  • trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp

    r156151 r156285  
    145145    }
    146146
    147     for (renderer = renderer->firstChild(); renderer; renderer = renderer->nextSibling())
     147    for (renderer = renderer->firstChildSlow(); renderer; renderer = renderer->nextSibling())
    148148        gatherLayersUsingRenderObjectHierarchy(errorString, renderer, layers);
    149149}
  • trunk/Source/WebCore/plugins/IFrameShimSupport.cpp

    r155507 r156285  
    103103            ASSERT(parent == ro2->parent());
    104104
    105             for (const RenderObject* ro = parent->firstChild(); ro; ro = ro->nextSibling()) {
     105            for (const RenderObject* ro = parent->firstChildSlow(); ro; ro = ro->nextSibling()) {
    106106                if (ro == ro1)
    107107                    return false;
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r143762 r156285  
    138138
    139139    RenderObject* firstRow = section->firstChild();
    140     for (RenderObject* child = firstRow->firstChild(); child; child = child->nextSibling()) {
     140    for (RenderObject* child = firstRow->firstChildSlow(); child; child = child->nextSibling()) {
    141141        if (!child->isTableCell())
    142142            continue;
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r156094 r156285  
    269269}
    270270
    271 static inline bool isLastChildForRenderer(RenderObject* ancestor, RenderObject* child)
     271static inline bool isLastChildForRenderer(RenderElement* ancestor, RenderObject* child)
    272272{
    273273    if (!child)
     
    278278
    279279    RenderObject* curr = child;
    280     RenderObject* parent = curr->parent();
     280    RenderElement* parent = curr->parent();
    281281    while (parent && (!parent->isRenderBlock() || parent->isInline())) {
    282282        if (parent->lastChild() != curr)
  • trunk/Source/WebCore/rendering/InlineIterator.h

    r156039 r156285  
    181181        return false;
    182182
    183     for (RenderObject* curr = object->firstChild(); curr; curr = curr->nextSibling()) {
     183    for (RenderObject* curr = toRenderElement(object)->firstChild(); curr; curr = curr->nextSibling()) {
    184184        if (curr->isFloatingOrOutOfFlowPositioned())
    185185            continue;
     
    207207        next = 0;
    208208        if (!oldEndOfInline && !isIteratorTarget(current)) {
    209             next = current->firstChild();
     209            next = toRenderElement(current)->firstChild();
    210210            notifyObserverEnteredObject(observer, next);
    211211        }
     
    274274}
    275275
    276 static inline RenderObject* bidiFirstSkippingEmptyInlines(RenderObject* root, InlineBidiResolver* resolver = 0)
     276static inline RenderObject* bidiFirstSkippingEmptyInlines(RenderElement* root, InlineBidiResolver* resolver = 0)
    277277{
    278278    RenderObject* o = root->firstChild();
     
    302302
    303303// FIXME: This method needs to be renamed when bidiNext finds a good name.
    304 static inline RenderObject* bidiFirstIncludingEmptyInlines(RenderObject* root)
     304static inline RenderObject* bidiFirstIncludingEmptyInlines(RenderElement* root)
    305305{
    306306    RenderObject* o = root->firstChild();
     
    325325class InlineWalker {
    326326public:
    327     InlineWalker(RenderObject* root)
     327    InlineWalker(RenderElement* root)
    328328        : m_root(root)
    329329        , m_current(0)
     
    334334    }
    335335
    336     RenderObject* root() { return m_root; }
     336    RenderElement* root() { return m_root; }
    337337    RenderObject* current() { return m_current; }
    338338
     
    347347    }
    348348private:
    349     RenderObject* m_root;
     349    RenderElement* m_root;
    350350    RenderObject* m_current;
    351351    bool m_atEndOfInline;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156278 r156285  
    10791079
    10801080    // 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())
    10821083        return false;
    10831084
     
    50815082            (current == parent ||
    50825083             (!current->isFloating() && !current->isReplaced() && !current->isOutOfFlowPositioned())))
    5083             result = current->firstChild();
     5084            result = current->firstChildSlow();
    50845085        if (!result) {
    50855086            // We hit the end of our inline. (It was empty, e.g., <span></span>.)
     
    57465747        // of flexbox.
    57475748        if (firstLineBlock->isReplaced() || firstLineBlock->isFloating()
    5748             || !parentBlock || parentBlock->firstChild() != firstLineBlock || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton()))
     5749            || !parentBlock || parentBlock->firstChildSlow() != firstLineBlock || (!parentBlock->isRenderBlockFlow() && !parentBlock->isRenderButton()))
    57495750            break;
    57505751        ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isRenderBlock());
     
    57865787}
    57875788
    5788 static inline RenderObject* findFirstLetterBlock(RenderBlock* start)
    5789 {
    5790     RenderObject* firstLetterBlock = start;
     5789static inline RenderElement* findFirstLetterBlock(RenderBlock* start)
     5790{
     5791    RenderElement* firstLetterBlock = start;
    57915792    while (true) {
    57925793        // We include isRenderButton in these two checks because buttons are
     
    58025803            return firstLetterBlock;
    58035804
    5804         RenderObject* 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()))
    58075808            return 0;
    58085809        firstLetterBlock = parentBlock;
     
    59455946
    59465947    // Drill into inlines looking for our first text child.
    5947     RenderObject* currChild = firstLetterBlock->firstChild();
     5948    RenderObject* currChild = firstLetterBlock->firstChildSlow();
    59485949    while (currChild) {
    59495950        if (currChild->isText())
     
    59535954        else if (currChild->isFloatingOrOutOfFlowPositioned()) {
    59545955            if (currChild->style()->styleType() == FIRST_LETTER) {
    5955                 currChild = currChild->firstChild();
     5956                currChild = currChild->firstChildSlow();
    59565957                break;
    59575958            }
     
    59625963            // We found a lower-level node with first-letter, which supersedes the higher-level style
    59635964            firstLetterBlock = currChild;
    5964             currChild = currChild->firstChild();
     5965            currChild = currChild->firstChildSlow();
    59655966        } else
    5966             currChild = currChild->firstChild();
     5967            currChild = currChild->firstChildSlow();
    59675968    }
    59685969
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r156278 r156285  
    40834083
    40844084    for (RenderObject* renderObject = firstChild(); renderObject; renderObject = renderObject->nextSibling()) {
    4085         if ((!renderObject->firstChild() && !renderObject->isInline() && !renderObject->isRenderBlockFlow() )
    4086             || renderObject->style()->visibility() != VISIBLE)
    4087             continue;
    4088        
    40894085        if (!renderObject->isBox())
    40904086            continue;
    4091        
    40924087        RenderBox* renderer = toRenderBox(renderObject);
     4088
     4089        if ((!renderer->firstChild() && !renderer->isInline() && !renderer->isRenderBlockFlow() )
     4090            || renderer->style()->visibility() != VISIBLE)
     4091            continue;
    40934092
    40944093        LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? LayoutUnit() : renderer->y());
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r156278 r156285  
    327327}
    328328
    329 static void addLayers(RenderObject* obj, RenderLayer* parentLayer, RenderElement*& newObject, RenderLayer*& beforeChild)
     329static void addLayers(RenderElement* obj, RenderLayer* parentLayer, RenderElement*& newObject, RenderLayer*& beforeChild)
    330330{
    331331    if (obj->hasLayer()) {
     
    341341    }
    342342
    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    }
    345347}
    346348
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156278 r156285  
    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; }
     41    RenderObject* firstChild() const { return m_firstChild; }
     42    RenderObject* lastChild() const { return m_lastChild; }
    4343
    4444    virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true; }
     
    8080    void generatingNode() const WTF_DELETED_FUNCTION;
    8181    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(); }
    8286
    8387    RenderObject* m_firstChild;
  • trunk/Source/WebCore/rendering/RenderFrameBase.cpp

    r155806 r156285  
    9797    ASSERT(!childFrameView->layoutPending());
    9898    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());
    100100
    101101    setNeedsLayout(false);
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r156223 r156285  
    11391139                    break;
    11401140                }
    1141                 if (r->firstChild() && !r->hasLayer())
    1142                     r = r->firstChild();
     1141                RenderObject* child;
     1142                if (!r->hasLayer() && (child = r->firstChildSlow()))
     1143                    r = child;
    11431144                else if (r->nextSibling())
    11441145                    r = r->nextSibling();
  • trunk/Source/WebCore/rendering/RenderListItem.cpp

    r156155 r156285  
    261261}
    262262
    263 static RenderObject* firstNonMarkerChild(RenderObject* parent)
     263static RenderObject* firstNonMarkerChild(RenderBlock* parent)
    264264{
    265265    RenderObject* result = parent->firstChild();
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r156278 r156285  
    216216    setFlowThreadState(state);
    217217
    218     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     218    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) {
    219219        // If the child is a fragmentation context it already updated the descendants flag accordingly.
    220220        if (child->isRenderFlowThread())
     
    245245RenderObject* RenderObject::nextInPreOrder() const
    246246{
    247     if (RenderObject* o = firstChild())
     247    if (RenderObject* o = firstChildSlow())
    248248        return o;
    249249
     
    267267RenderObject* RenderObject::nextInPreOrder(const RenderObject* stayWithin) const
    268268{
    269     if (RenderObject* o = firstChild())
     269    if (RenderObject* o = firstChildSlow())
    270270        return o;
    271271
     
    291291{
    292292    if (RenderObject* o = previousSibling()) {
    293         while (o->lastChild())
    294             o = o->lastChild();
     293        while (RenderObject* last = o->lastChildSlow())
     294            o = last;
    295295        return o;
    296296    }
     
    309309RenderObject* RenderObject::childAt(unsigned index) const
    310310{
    311     RenderObject* child = firstChild();
     311    RenderObject* child = firstChildSlow();
    312312    for (unsigned i = 0; child && i < index; i++)
    313313        child = child->nextSibling();
     
    317317RenderObject* RenderObject::firstLeafChild() const
    318318{
    319     RenderObject* r = firstChild();
     319    RenderObject* r = firstChildSlow();
    320320    while (r) {
    321321        RenderObject* n = 0;
    322         n = r->firstChild();
     322        n = r->firstChildSlow();
    323323        if (!n)
    324324            break;
     
    330330RenderObject* RenderObject::lastLeafChild() const
    331331{
    332     RenderObject* r = lastChild();
     332    RenderObject* r = lastChildSlow();
    333333    while (r) {
    334334        RenderObject* n = 0;
    335         n = r->lastChild();
     335        n = r->lastChildSlow();
    336336        if (!n)
    337337            break;
     
    12291229    if (hasLayer())
    12301230        result.unite(absoluteBoundingBoxRectIgnoringTransforms());
    1231     for (RenderObject* current = firstChild(); current; current = current->nextSibling())
     1231    for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling())
    12321232        current->addAbsoluteRectForLayer(result);
    12331233}
     
    12381238    LayoutRect result = absoluteBoundingBoxRectIgnoringTransforms();
    12391239    topLevelRect = result;
    1240     for (RenderObject* current = firstChild(); current; current = current->nextSibling())
     1240    for (RenderObject* current = firstChildSlow(); current; current = current->nextSibling())
    12411241        current->addAbsoluteRectForLayer(result);
    12421242    return result;
     
    15921592        return;
    15931593
    1594     for (const RenderObject* child = firstChild(); child; child = child->nextSibling())
     1594    for (const RenderObject* child = firstChildSlow(); child; child = child->nextSibling())
    15951595        child->showRenderTreeAndMark(markedObject1, markedLabel1, markedObject2, markedLabel2, depth + 1);
    15961596}
     
    17801780inline bool RenderObject::hasImmediateNonWhitespaceTextChild() const
    17811781{
    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()) {
    17831785        if (r->isText() && !toRenderText(r)->isAllCollapsibleWhitespace())
    17841786            return true;
     
    20162018{
    20172019    // 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()) {
    20192021        if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
    20202022            continue;
     
    25162518void RenderObject::removeFromRenderFlowThreadRecursive(RenderFlowThread* renderFlowThread)
    25172519{
    2518     for (RenderObject* child = firstChild(); child; child = child->nextSibling())
     2520    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling())
    25192521        child->removeFromRenderFlowThreadRecursive(renderFlowThread);
    25202522
     
    25362538
    25372539    RenderObject* destroyRoot = this;
    2538     for (RenderObject* 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()) {
    25392541        // Currently we only remove anonymous cells' and table sections' wrappers but we should remove all unneeded
    25402542        // wrappers. See http://webkit.org/b/52123 as an example where this is needed.
     
    26152617    if (valueChanged && node() && (style()->affectedByDrag() || (node()->isElementNode() && toElement(node())->childrenAffectedByDrag())))
    26162618        node()->setNeedsStyleRecalc();
    2617     for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
     2619    for (RenderObject* curr = firstChildSlow(); curr; curr = curr->nextSibling())
    26182620        curr->updateDragState(dragOn);
    26192621}
     
    26882690    StackStats::LayoutCheckPoint layoutCheckPoint;
    26892691    ASSERT(needsLayout());
    2690     RenderObject* child = firstChild();
     2692    RenderObject* child = firstChildSlow();
    26912693    while (child) {
    26922694        child->layoutIfNeeded();
     
    29132915
    29142916    addAnnotatedRegions(regions);
    2915     for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
     2917    for (RenderObject* curr = toRenderElement(this)->firstChild(); curr; curr = curr->nextSibling())
    29162918        curr->collectAnnotatedRegions(regions);
    29172919}
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156278 r156285  
    165165    RenderObject* nextSibling() const { return m_next; }
    166166
    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; }
    171170
    172171    RenderObject* nextInPreOrder() const;
     
    225224    RenderNamedFlowThread* renderNamedFlowThreadWrapper() const;
    226225
    227     virtual bool isEmpty() const { return firstChild() == 0; }
     226    // FIXME: The meaning of this function is unclear.
     227    virtual bool isEmpty() const { return !firstChildSlow(); }
    228228
    229229#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r156250 r156285  
    581581void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object)
    582582{
    583     for (RenderObject* child = object->firstChild(); child; child = child->nextSibling()) {
     583    for (RenderObject* child = object->firstChildSlow(); child; child = child->nextSibling()) {
    584584
    585585        RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find(child);
     
    633633
    634634    // 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())
    636636        clearObjectStyleInRegion(child);
    637637}
  • trunk/Source/WebCore/rendering/RenderRuby.cpp

    r156151 r156285  
    6060    return isAnonymousRubyInlineBlock(object)
    6161        && !object->previousSibling()
    62         && object->firstChild()
    63         && object->firstChild()->style()->styleType() == BEFORE;
     62        && object->firstChildSlow()
     63        && object->firstChildSlow()->style()->styleType() == BEFORE;
    6464}
    6565
     
    6868    return isAnonymousRubyInlineBlock(object)
    6969        && !object->nextSibling()
    70         && object->firstChild()
    71         && object->firstChild()->style()->styleType() == AFTER;
     70        && object->firstChildSlow()
     71        && object->firstChildSlow()->style()->styleType() == AFTER;
    7272}
    7373
    7474static inline RenderBlock* rubyBeforeBlock(const RenderObject* ruby)
    7575{
    76     RenderObject* child = ruby->firstChild();
     76    RenderObject* child = ruby->firstChildSlow();
    7777    return isRubyBeforeBlock(child) ? toRenderBlock(child) : 0;
    7878}
     
    8080static inline RenderBlock* rubyAfterBlock(const RenderObject* ruby)
    8181{
    82     RenderObject* child = ruby->lastChild();
     82    RenderObject* child = ruby->lastChildSlow();
    8383    return isRubyAfterBlock(child) ? toRenderBlock(child) : 0;
    8484}
     
    9494static RenderRubyRun* lastRubyRun(const RenderObject* ruby)
    9595{
    96     RenderObject* child = ruby->lastChild();
     96    RenderObject* child = ruby->lastChildSlow();
    9797    if (child && !child->isRubyRun())
    9898        child = child->previousSibling();
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r156166 r156285  
    185185        lastBox = lastBox->parent();
    186186    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);
    190191        return;
    191192    }
     
    569570        if (!section->isTableSection())
    570571            continue;
    571         for (RenderObject* row = section->firstChild(); row; row = row->nextSibling()) {
     572        for (RenderObject* row = toRenderTableSection(section)->firstChild(); row; row = row->nextSibling()) {
    572573            if (!row->isTableRow())
    573574                continue;
    574             for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
     575            for (RenderObject* cell = toRenderTableRow(row)->firstChild(); cell; cell = cell->nextSibling()) {
    575576                if (!cell->isTableCell())
    576577                    continue;
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r156151 r156285  
    112112            last = lastChild();
    113113        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);
    117118            return;
    118119        }
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r156166 r156285  
    131131            last = lastChild();
    132132        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);
    136137            return;
    137138        }
     
    12351236            setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(m_grid[insertionRow]);
    12361237
    1237             for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
     1238            for (RenderObject* cell = tableRow->firstChild(); cell; cell = cell->nextSibling()) {
    12381239                if (!cell->isTableCell())
    12391240                    continue;
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r156054 r156285  
    598598    }
    599599
    600     for (RenderObject* child = o.firstChild(); child; child = child->nextSibling()) {
     600    for (RenderObject* child = o.firstChildSlow(); child; child = child->nextSibling()) {
    601601        if (child->hasLayer())
    602602            continue;
     
    919919    if (!parent)
    920920        return;
    921     for (RenderObject* child = parent->firstChild(); child; child = child->nextSibling()) {
     921    for (RenderObject* child = parent->firstChildSlow(); child; child = child->nextSibling()) {
    922922        if (child->isCounter()) {
    923923            if (!isFirstCounter)
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp

    r156151 r156285  
    124124    if (!numeratorWrapper)
    125125        return 0;
    126     RenderObject* numerator = numeratorWrapper->firstChild();
     126    RenderObject* numerator = numeratorWrapper->firstChildSlow();
    127127    if (!numerator || !numerator->isRenderMathMLBlock())
    128128        return 0;
  • trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp

    r155756 r156285  
    141141    ASSERT(locateElement);
    142142    // FIXME: Make this iterative.
    143     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
     143    for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) {
    144144        if (child->isSVGInlineText()) {
    145145            RenderSVGInlineText* text = toRenderSVGInlineText(child);
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp

    r154462 r156285  
    146146}
    147147
    148 void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox)
     148void SVGRenderSupport::computeContainerBoundingBoxes(const RenderElement* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox)
    149149{
    150150    objectBoundingBox = FloatRect();
     
    196196        resources->removeClientFromCache(start, false);
    197197
    198     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling())
     198    for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling())
    199199        invalidateResourcesOfChildren(child);
    200200}
     
    234234    HashSet<RenderObject*> notlayoutedObjects;
    235235
    236     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
     236    for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) {
    237237        bool needsLayout = selfNeedsLayout;
    238238        bool childEverHadLayout = child->everHadLayout();
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.h

    r137847 r156285  
    3535class LayoutRect;
    3636class RenderBoxModelObject;
     37class RenderElement;
    3738class RenderGeometryMap;
    3839class RenderLayerModelObject;
     
    6263    static bool pointInClippingArea(RenderObject*, const FloatPoint&);
    6364
    64     static void computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox);
     65    static void computeContainerBoundingBoxes(const RenderElement* container, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox);
    6566    static bool paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo&);
    6667
  • trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

    r156102 r156285  
    467467static void writeChildren(TextStream& ts, const RenderObject& object, int indent)
    468468{
    469     for (RenderObject* child = object.firstChild(); child; child = child->nextSibling())
     469    for (RenderObject* child = object.firstChildSlow(); child; child = child->nextSibling())
    470470        write(ts, *child, indent + 1);
    471471}
  • trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp

    r95901 r156285  
    7171    // <marker id="a"> <path marker-start="url(#b)"/> ...
    7272    // <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()) {
    7474        SVGResources* childResources = SVGResourcesCache::cachedResourcesForRenderObject(child);
    7575        if (!childResources)
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

    r130612 r156285  
    107107    ASSERT(!start->isSVGText() || m_textPositions.isEmpty());
    108108
    109     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
     109    for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) {
    110110        if (child->isSVGInlineText()) {
    111111            processRenderSVGInlineText(toRenderSVGInlineText(child), m_textLength, lastCharacter);
  • trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp

    r138316 r156285  
    180180void SVGTextMetricsBuilder::walkTree(RenderObject* start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
    181181{
    182     for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
     182    for (RenderObject* child = start->firstChildSlow(); child; child = child->nextSibling()) {
    183183        if (child->isSVGInlineText()) {
    184184            RenderSVGInlineText* text = toRenderSVGInlineText(child);
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r156250 r156285  
    341341            return false;
    342342       
    343         RenderObject* first = parentRenderer.firstChild();
     343        RenderObject* first = parentRenderer.firstChildSlow();
    344344        while (first && first->isFloatingOrOutOfFlowPositioned())
    345345            first = first->nextSibling();
  • trunk/Source/WebKit/mac/WebView/WebRenderNode.mm

    r154449 r156285  
    8787{
    8888    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()) {
    9090        WebRenderNode *childCopy = copyRenderNode(child);
    9191        [children addObject:childCopy];
  • trunk/Source/WebKit2/Shared/WebRenderObject.cpp

    r154449 r156285  
    9191
    9292    m_children = MutableArray::create();
    93     for (RenderObject* coreChild = renderer->firstChild(); coreChild; coreChild = coreChild->nextSibling()) {
     93    for (RenderObject* coreChild = renderer->firstChildSlow(); coreChild; coreChild = coreChild->nextSibling()) {
    9494        RefPtr<WebRenderObject> child = adoptRef(new WebRenderObject(coreChild, shouldIncludeDescendants));
    9595        m_children->append(child.get());
Note: See TracChangeset for help on using the changeset viewer.