Skip to content
  • ap's avatar
    Reviewed by Darin. · 16c9b5f7
    ap authored
            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: http://svn.webkit.org/repository/webkit/trunk@20554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    16c9b5f7