2009-11-13 Carol Szabo <carol.szabo@nokia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 20:21:44 +0000 (20:21 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Nov 2009 20:21:44 +0000 (20:21 +0000)
commit313f3bb1b3f20911eb2e66f9a159cacee2bf2f6d
tree585b26dd9dfba79173db47ad61615b1c386807a6
parent8fffbc49cba4e84e53d5ebe4d2ba2580553a48ce
2009-11-13  Carol Szabo  <carol.szabo@nokia.com>

        Reviewed by Darin Adler.

        The CounterNode class is missing some basic tree navigation methods common in other WebKit trees such as the rendering tree
        https://bugs.webkit.org/show_bug.cgi?id=31213
        Added tree navigation methods that permit full implementation of CSS2.1
        counter feature without using recursion proportional to the counter
        tree depth.
        No new tests because I did not find any bug that is fixed by this
        commit yet, this just reduces the size of the patch for 11031 and
        helps respond to some concerns regarding that patch.

        * rendering/CounterNode.cpp:
        (WebCore::CounterNode::CounterNode):

        (WebCore::CounterNode::nextInPreOrderAfterChildren):
        (WebCore::CounterNode::nextInPreOrder):
        Added to support non-recursive tree traversal necessary for
        efficient full implementation of CSS2.1 counters.

        (WebCore::CounterNode::lastDescendant):
        (WebCore::CounterNode::previousInPreOrder):
        Moved this methods such that they occupy a place similar to that of
        identically named methods on the render tree. This allows for their
        broader use needed in full implementation of CSS2.1 counters.

        (WebCore::CounterNode::resetRenderer):
        (WebCore::CounterNode::resetRenderers):
        (WebCore::CounterNode::recount):
        (WebCore::CounterNode::insertAfter):
        (WebCore::CounterNode::removeChild):
        Changed such that insertion/removal of a counter, triggers not only
        recalculation of PrefixWidths, but also reassesment of values in
        counter nodes. This is the basis full implementation of CSS2.1
        counters. It does not change current behavior by much because of
        changes needed to the recalculation algorithm, but those are comming
        in the patch for 11031.
        (WebCore::showTreeAndMark):
        * rendering/CounterNode.h:
        * rendering/RenderCounter.cpp:
        (WebCore::counter):
        Only changed argument type to prepare for implementation of Darin
        Adler's recommendation for the patch to 11031.

        (WebCore::RenderCounter::invalidate):
        (WebCore::destroyCounterNodeChildren):
        (WebCore::RenderCounter::destroyCounterNodes):
        * rendering/RenderCounter.h:
        * rendering/RenderObjectChildList.cpp:
        (WebCore::invalidateCountersInContainer):
        (WebCore::RenderObjectChildList::invalidateCounters):
        * rendering/RenderObjectChildList.h:
        Added the ability to restrict invalidation to counters with a given
        identifier.
        Also invalidated counters that are on the child container itself
        which were missed by the previous algorithm, but were a valid case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/rendering/CounterNode.cpp
WebCore/rendering/CounterNode.h
WebCore/rendering/RenderCounter.cpp
WebCore/rendering/RenderCounter.h
WebCore/rendering/RenderObjectChildList.cpp
WebCore/rendering/RenderObjectChildList.h