Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2007 08:39:27 +0000 (08:39 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2007 08:39:27 +0000 (08:39 +0000)
commit7df14a212a679155c1d92f11752b60cd58b06808
tree7c37970a4a12fbd7d32e8548f5489bc7beef4d19
parent7e50fb49171165f430bbeb812a4f0ac9888a9a46
    Reviewed by Darin.

        A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
        XPath can be very slow

        * xml/XPathExpression.cpp:
        (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
        from being destroyed in time.

        * dom/Attr.cpp:
        (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
        * dom/ContainerNode.h:
        (WebCore::ContainerNode::fastSetFirstChild):
        (WebCore::ContainerNode::fastSetLastChild):
        Added operations that let Attr hack internal ContainerNode data (evil, but fast!).

        * xml/XPathStep.cpp:
        (WebCore::XPath::Step::evaluate):
        (WebCore::XPath::Step::nodesInAxis):
        (WebCore::XPath::Step::nodeMatches):
        * xml/XPathStep.h:
        Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future
        optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/dom/Attr.cpp
WebCore/dom/ContainerNode.h
WebCore/xml/XPathExpression.cpp
WebCore/xml/XPathStep.cpp
WebCore/xml/XPathStep.h