I am using the nightly builds to gain JS access to XPath selection of nodes. In the test case I create an XHTML2 using a string in JS and calling the DOMParser. To match on namespaced elements, I create a resolver with xmldoc.createNSResolver and pass it into the xmldoc.evaluate call. Unfortunately the XPath selection matches nothing in WebKit. It works in Firefox.
Created attachment 8457 [details] createNSResolver test case A test case with HTML and JS that works in Firefox but fails in the WebKit nightly from May 20 2006.
Created attachment 8680 [details] Patch
Comment on attachment 8680 [details] Patch -Step::Step(AxisType axis, const String& nodeTest, const Vector<Predicate*>& predicates) +Step::Step(AxisType axis, const String& nodeTest, const Vector<Predicate*> &predicates) The above is not a good change. + Parser *parser = Parser::current(); We put the * next to the type. + if (!parser->m_currentNamespaceURI.isNull()) { + m_namespaceURI = parser->m_currentNamespaceURI; + parser->m_currentNamespaceURI = String(); + } Why the if here? Seems that check should be omitted. + $$ = new String($1->deprecatedString().mid(colon + 1)); This could use String::substring and then you would not need to bother with the conversion to/from DeprecatedString. r=me
I got an idea: - if (m_nodeSetPosition + 1 >= m_nodeSet.size()) + if (m_nodeSetPosition + 1 > m_nodeSet.size()) This could also be fixed by removing the +1 and keeping the =.
I just tried the test case in the most recent nightly and it now passes. Thanks Anders!
Mass moving XML DOM bugs to the "DOM" Component.