Closed
Bug 816380
Opened 13 years ago
Closed 13 years ago
Convert XPathEvaluator to WebIDL
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
14.38 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
This way I can remove some quickstubs once we do Document.
![]() |
Assignee | |
Updated•13 years ago
|
Blocks: ParisBindings
Whiteboard: [need review]
![]() |
Assignee | |
Comment 1•13 years ago
|
||
Attachment #686391 -
Flags: review?(peterv)
Comment 2•13 years ago
|
||
Comment on attachment 686391 [details] [diff] [review]
Convert XPathEvaluator to WebIDL.
Review of attachment 686391 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/xslt/src/xpath/nsXPathEvaluator.cpp
@@ +219,5 @@
> +}
> +
> +/* static */
> +already_AddRefed<nsXPathEvaluator>
> +nsXPathEvaluator::Constructor(nsISupports* aGlobal, mozilla::ErrorResult& rv)
s/mozilla:://
@@ +242,5 @@
> + ErrorResult& rv)
> +{
> + nsCOMPtr<nsIDOMNode> nodeResolver = do_QueryInterface(aNodeResolver);
> + nsCOMPtr<nsIDOMXPathNSResolver> res;
> + rv = CreateNSResolver(nodeResolver, getter_AddRefs(res));
I'd just do |rv = CreateNSResolver(aNodeResolver->AsDOMNode(), getter_AddRefs(res));|
@@ +253,5 @@
> + nsISupports* aResult, ErrorResult& rv)
> +{
> + nsCOMPtr<nsIDOMNode> contextNode = do_QueryInterface(aContextNode);
> + nsCOMPtr<nsISupports> res;
> + rv = Evaluate(aExpression, contextNode, aResolver, aType,
Same here.
::: dom/webidl/XPathEvaluator.webidl
@@ +13,5 @@
> + // Based on nsIDOMXPathEvaluator
> + [Creator, Throws]
> + XPathExpression createExpression(DOMString expression,
> + XPathNSResolver? resolver);
> + [Creator, Throws]
Please file a followup to remove this Throws, I think the security exception can go and the OOM too.
@@ +16,5 @@
> + XPathNSResolver? resolver);
> + [Creator, Throws]
> + XPathNSResolver createNSResolver(Node? nodeResolver);
> + [Throws]
> + nsISupports evaluate(DOMString expression, Node? contextNode,
I'd make this return XPathResult and map that to nsISupports. The spec has DOMObject and specifies that it is a XPathResult for XPath 1.0. We only support 1.0 anyway.
@@ +18,5 @@
> + XPathNSResolver createNSResolver(Node? nodeResolver);
> + [Throws]
> + nsISupports evaluate(DOMString expression, Node? contextNode,
> + XPathNSResolver? resolver, unsigned short type,
> + nsISupports? result);
Same here.
Attachment #686391 -
Flags: review?(peterv) → review+
![]() |
Assignee | |
Comment 3•13 years ago
|
||
> s/mozilla:://
Done.
> I'd just do |rv = CreateNSResolver(aNodeResolver->AsDOMNode(), getter_AddRefs(res));|
aNodeResolver can be null as the IDL is currently written... I'll leave this as-is for the moment until we fix that.
> Please file a followup to remove this Throws
Filed bug 821808.
> The spec has DOMObject and specifies that it is a XPathResult for XPath 1.0.
There's a spec? I just based it on our xpidl.... Will do, in any case.
![]() |
Assignee | |
Comment 4•13 years ago
|
||
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla20
Comment 5•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 6•13 years ago
|
||
> 5.35 +addExternalIface('nsISupports', nativeType='nsISupports')
> 8.11 +interface nsISupports;
Is this needed?
![]() |
Assignee | |
Comment 7•12 years ago
|
||
> Is this needed?
No, good catch. Pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/c94c3ad9317d to remove it.
Comment 8•12 years ago
|
||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•