Closed
Bug 384003
Opened 18 years ago
Closed 16 years ago
XPathEvaluator does not accept a Node as NSResolver
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sjoerd, Assigned: smaug)
Details
Attachments
(2 files, 1 obsolete file)
|
722 bytes,
text/html
|
Details | |
|
13.63 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
The XpathEvaluator accepts besides objects created with createNSResolver also any object with a lookupNamespaceURI method.
As any Node has a lookupNamespaceURI method, I expected XPathEvaluator also to accept a Node as a NSResolver, but I get this error:
Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"
Reproducible: Always
Comment 1•18 years ago
|
||
Sjoerd, can you provide an actual testcase - the XML and JS code you used to generate this error?
| Reporter | ||
Comment 2•18 years ago
|
||
That would be the Xopus product, 1.5Mb of JS code. I don't think that would help you much. Do you have a basic XSLT test case somewhere that I can adapt?
Comment 3•17 years ago
|
||
This works in Safari 3.1.2 and Opera 9.52.
| Assignee | ||
Comment 4•17 years ago
|
||
Per spec what we do is enough, but should be easy to add support for
node as resolver.
Assignee: nobody → Olli.Pettay
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 5•17 years ago
|
||
We could do it this way. No need to implement anything new, just make
dom nodes to implement resolver interface.
Attachment #345716 -
Flags: superreview?(peterv)
Attachment #345716 -
Flags: review?(peterv)
| Assignee | ||
Comment 6•17 years ago
|
||
The applies still to trunk (with some fuzz).
> The XpathEvaluator accepts besides objects created with createNSResolver also
> any object with a lookupNamespaceURI method.
There is no spec that says that this is the case.
It was however recently suggested that nodes should implement XPathNSResolver which would make passing nodes as resolvers work.
Attachment #345716 -
Flags: review?(peterv) → review+
Comment on attachment 345716 [details] [diff] [review]
possible fix
Peterv, what do you think?
Updated•17 years ago
|
Attachment #345716 -
Flags: superreview?(peterv) → superreview-
Comment 9•17 years ago
|
||
Comment on attachment 345716 [details] [diff] [review]
possible fix
This is slightly different from what Webkit does, Webkit allows any object that has a lookupNamespaceURI method. In practice it will work the same for now, because our nodes seem to be the only objects that have a lookupNamespaceURI method.
I think we need to make createNSResolver do a QI on the node instead of returning a new nsXPathNSResolver. If we add nsIDOMXPathNSResolver to nsNode3Tearoff then we should remove nsXPathNSResolver (the alternative would be to make nsXPathNSResolver a tearoff of nodes instead). Might also want to add nsIDOMXPathNSResolver to the DOMCI data for all nodes and remove the XPathNSResolver DOMCI data.
Sicking: don't we need to add CanCallerAccess to places where we take a nsIDOMXPathNSResolver if someone passes in a node?
Actually, XOWs should remove the need for CanCallerAccess, everywhere. Just think we've been conservative elsewhere.
And technically making createNSResolver return a Node would be violating specs. At least the spirit if them.
Comment 11•17 years ago
|
||
Comment on attachment 345716 [details] [diff] [review]
possible fix
Hmm, guess so.
Attachment #345716 -
Flags: superreview- → superreview+
| Assignee | ||
Comment 12•17 years ago
|
||
Attachment #345716 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 14•16 years ago
|
||
(This seems to have improved TDHTML on Vista, at least! Good job!)
You need to log in
before you can comment on or make changes to this bug.
Description
•