Closed Bug 1318479 Opened 3 years ago Closed 3 years ago

Get rid of uses of nsIDOMNode::AppendChild in our tree

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(7 files)

No description provided.
Depends on: 1318480
Comment on attachment 8811964 [details] [diff] [review]
part 2.  Remove uses of nsIDOMNode::AppendChild in editor

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

::: editor/libeditor/HTMLEditorDataTransfer.cpp
@@ +2097,5 @@
>      NS_ENSURE_SUCCESS(rv, rv);
>    }
>  
>    nsCOMPtr<nsIContent> contextLeafAsContent = do_QueryInterface(contextLeaf);
> +  nsCOMPtr<nsINode> contextLeafAsNode = do_QueryInterface(contextLeaf);

Why not just use contextLeafAsContent?
Attachment #8811964 - Flags: review?(ehsan) → review-
> Why not just use contextLeafAsContent?

Is contextLeaf guaranteed to not be a document node?
Flags: needinfo?(ehsan)
Attachment #8811963 - Flags: review?(peterv) → review+
(In reply to Boris Zbarsky [:bz] (still a bit busy) from comment #5)
> > Why not just use contextLeafAsContent?
> 
> Is contextLeaf guaranteed to not be a document node?

Yes, since it comes from the return value of FindTargetNode(), which is guaranteed to be a child node under a document fragment.
Flags: needinfo?(ehsan)
Comment on attachment 8812048 [details] [diff] [review]
part 3.  Remove uses of nsIDOMNode::AppendChild in HTMLOptionsCollection

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

Stealing!
Attachment #8812048 - Flags: review?(peterv) → review+
Comment on attachment 8812060 [details] [diff] [review]
part 4.  Remove use of nsIDOMNode::AppendChild from NS_NewDOMDocument

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

::: dom/html/HTMLSelectElement.h
@@ -271,5 @@
>    using nsIConstraintValidation::ReportValidity;
>    // nsIConstraintValidation::SetCustomValidity() is fine.
>  
>    using nsINode::Remove;
> -  using nsINode::AppendChild;

Not sure why this hunk is needed....

::: dom/xml/XMLDocument.cpp
@@ +163,5 @@
>    }
>    
>    if (!aQualifiedName.IsEmpty()) {
> +    ErrorResult result;
> +    nsCOMPtr<Element> root = 

Nit: trailing space.
Attachment #8812060 - Flags: review?(peterv) → review+
Attachment #8812061 - Flags: review?(peterv) → review+
> Not sure why this hunk is needed....

Good catch.  This hunk shouldn't be here!  It's a refugee from bug 1318476.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ae0e57c5add3
part 1.  Remove uses of nsIDOMNode::AppendChild in XSLT code.  r=peterv
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9bd452a8b45
part 2.  Remove uses of nsIDOMNode::AppendChild in editor.  r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/8b6abb058e6a
part 3.  Remove uses of nsIDOMNode::AppendChild in HTMLOptionsCollection.  r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/333df199df73
part 4.  Remove use of nsIDOMNode::AppendChild from NS_NewDOMDocument.  r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/53efc7ed9314
part 5.  Remove nsIDOMNode::AppendChild from TextTrackCue.  r=ehsan
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.