WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
9035
document.evaluate and createNSResolver miss on namespaced elements
https://bugs.webkit.org/show_bug.cgi?id=9035
Summary
document.evaluate and createNSResolver miss on namespaced elements
Paul Everitt
Reported
2006-05-22 02:23:28 PDT
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.
Attachments
createNSResolver test case
(852 bytes, text/html)
2006-05-22 02:25 PDT
,
Paul Everitt
no flags
Details
Patch
(13.65 KB, patch)
2006-06-03 10:08 PDT
,
Anders Carlsson
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Paul Everitt
Comment 1
2006-05-22 02:25:13 PDT
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.
Anders Carlsson
Comment 2
2006-06-03 10:08:05 PDT
Created
attachment 8680
[details]
Patch
Darin Adler
Comment 3
2006-06-03 12:47:54 PDT
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
Darin Adler
Comment 4
2006-06-03 18:58:43 PDT
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 =.
Paul Everitt
Comment 5
2006-06-04 11:19:16 PDT
I just tried the test case in the most recent nightly and it now passes. Thanks Anders!
Lucas Forschler
Comment 6
2019-02-06 09:02:33 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug