Changeset 140913 in webkit


Ignore:
Timestamp:
Jan 26, 2013 11:29:18 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Text Autosizing: simplify and clean-up preOrderTraversal skipping containers
https://bugs.webkit.org/show_bug.cgi?id=107446

Patch by Tim Volodine <timvolodine@chromium.org> on 2013-01-26
Reviewed by Julien Chaffraix.

Simplify nextInPreOrderSkippingDescendantsOfContainers implementation
using RenderObject tree traversal methods.

No new tests because functionality is unchanged.

  • rendering/TextAutosizer.cpp:

(WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140911 r140913  
     12013-01-26  Tim Volodine  <timvolodine@chromium.org>
     2
     3        Text Autosizing: simplify and clean-up preOrderTraversal skipping containers
     4        https://bugs.webkit.org/show_bug.cgi?id=107446
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        Simplify nextInPreOrderSkippingDescendantsOfContainers implementation
     9        using RenderObject tree traversal methods.
     10
     11        No new tests because functionality is unchanged.
     12
     13        * rendering/TextAutosizer.cpp:
     14        (WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):
     15
    1162013-01-26  Dan Carney  <dcarney@google.com>
    217
  • trunk/Source/WebCore/rendering/TextAutosizer.cpp

    r140193 r140913  
    408408{
    409409    if (current == stayWithin || !isAutosizingContainer(current))
    410         for (RenderObject* child = current->firstChild(); child; child = child->nextSibling())
    411             return child;
    412 
    413     for (const RenderObject* ancestor = current; ancestor; ancestor = ancestor->parent()) {
    414         if (ancestor == stayWithin)
    415             return 0;
    416         for (RenderObject* sibling = ancestor->nextSibling(); sibling; sibling = sibling->nextSibling())
    417             return sibling;
    418     }
    419 
    420     return 0;
     410        return current->nextInPreOrder(stayWithin);
     411    return current->nextInPreOrderAfterChildren(stayWithin);
    421412}
    422413
Note: See TracChangeset for help on using the changeset viewer.