Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2007 16:48:16 +0000 (16:48 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2007 16:48:16 +0000 (16:48 +0000)
commitff3a7b3be1f63dd76ff4d65ecb3e0a8ffd7bbca6
tree25c76db8a923e847c44bbfe97c0ff1cd6dbbeb2a
parent93df51d9c9dfb28c9f8045ca30e5bd3501238b4b
    Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=13190
        XPath incorrectly handles namespaces on attributes

WebCore:
        * xml/XPathStep.cpp:
        (WebCore::XPath::Step::nodesInAxis): Added a special case for faster attribute lookup; gives a slight but
        measurable performance improvement for bug 13021.
        (WebCore::XPath::Step::nodeMatches): Fixed NameTest for attribute nodes.

        * xml/XPathStep.h:
        (WebCore::XPath::Step::NodeTest::NodeTest):
        (WebCore::XPath::Step::NodeTest::namespaceURI):
        (WebCore::XPath::Step::nodeTest):
        (WebCore::XPath::Step::setNodeTest):
        Move m_namespaceURI to NodeTest, where it belongs. Removed unused m_nodeTestData (oops!).

        * xml/XPathGrammar.y:
        * xml/XPathPath.cpp:
        (WebCore::XPath::LocationPath::optimizeStepPair):
        Accounted for the above change.

LayoutTests:
        * fast/xpath/attr-namespace-expected.txt: Added.
        * fast/xpath/attr-namespace.html: Added.

        * fast/xpath/xpath-namespaces-expected.txt:
        * fast/xpath/xpath-namespaces.html:
        Cleaned up; added a couple more cases (which passed anyway, but weren't tested for).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/xpath/attr-namespace-expected.txt [new file with mode: 0644]
LayoutTests/fast/xpath/attr-namespace.html [new file with mode: 0644]
LayoutTests/fast/xpath/xpath-namespaces-expected.txt
LayoutTests/fast/xpath/xpath-namespaces.html
WebCore/ChangeLog
WebCore/xml/XPathGrammar.y
WebCore/xml/XPathPath.cpp
WebCore/xml/XPathStep.cpp
WebCore/xml/XPathStep.h