Closed Bug 1301254 Opened 3 years ago Closed 3 years ago

nsINode::GetBaseURI() should be fallible

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- fix-optional
firefox52 --- fixed

People

(Reporter: njn, Assigned: baku)

Details

Attachments

(1 file, 1 obsolete file)

This is a spin-off of bug 1297300, which is adding checking for GetSpec() calls that are lacking them.

nsINode::GetBaseURI() has a GetSpec() call that is fallible. The right way to handle this is to make nsIDocument::GetDocumentURI() itself fallible. bz noted in bug 1297300 comment 31.

It should also be marked with MOZ_MUST_USE, of course :)
Please let me know if this should be a higher priority than "backlog".
Flags: needinfo?(n.nethercote)
Priority: -- → P3
> Please let me know if this should be a higher priority than "backlog".

That seems fine. Thank you for checking.
Flags: needinfo?(n.nethercote)
Attached patch doc2.patch (obsolete) — Splinter Review
Assignee: nobody → amarchesini
Attachment #8791139 - Flags: review?(n.nethercote)
Comment on attachment 8791139 [details] [diff] [review]
doc2.patch

Review of attachment 8791139 [details] [diff] [review]:
-----------------------------------------------------------------

Looks ok, but I'll defer to a DOM peer for r+.

::: dom/xslt/xpath/txXPathTreeWalker.h
@@ +92,5 @@
>      static int32_t getUniqueIdentifier(const txXPathNode& aNode);
>      static nsresult getXSLTId(const txXPathNode& aNode,
>                                const txXPathNode& aBase, nsAString& aResult);
>      static void release(txXPathNode* aNode);
> +    static nsresult getBaseURI(const txXPathNode& aNode, nsAString& aURI);

Please add MOZ_MUST_USE here.
Attachment #8791139 - Flags: review?(n.nethercote) → feedback+
Attachment #8791139 - Flags: review?(bugs)
Comment on attachment 8791139 [details] [diff] [review]
doc2.patch

Also in this bug, I don't understand why to use ErrorResult, when nsresult is the normal way to propagate errors in Gecko, and ErrorResult is more like webidl layer thing.
Attachment #8791139 - Flags: review?(bugs) → review-
Attached patch doc2.patchSplinter Review
Attachment #8791139 - Attachment is obsolete: true
Attachment #8792496 - Flags: review?(bugs)
Attachment #8792496 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31ea105ca2d9
nsINode::GetBaseURI() should be fallible, r=smaug
https://hg.mozilla.org/mozilla-central/rev/31ea105ca2d9
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Mark 51 as fix-optional. If it's worth uplift to 51, feel free to nominate it.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.