Closed
Bug 816380
Opened 11 years ago
Closed 11 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•11 years ago
|
Blocks: ParisBindings
Whiteboard: [need review]
![]() |
Assignee | |
Comment 1•11 years ago
|
||
Attachment #686391 -
Flags: review?(peterv)
Comment 2•11 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•11 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•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e0b4ce62d6d
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla20
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3e0b4ce62d6d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 6•11 years ago
|
||
> 5.35 +addExternalIface('nsISupports', nativeType='nsISupports')
> 8.11 +interface nsISupports;
Is this needed?
![]() |
Assignee | |
Comment 7•11 years ago
|
||
> Is this needed? No, good catch. Pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/c94c3ad9317d to remove it.
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c94c3ad9317d
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•