Bug 1318479 part 5. Remove nsIDOMNode::AppendChild from TextTrackCue. r=ehsan
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 18 Nov 2016 16:38:29 -0500
changeset 323498 53efc7ed9314bdbed46e718185394a4a2e4d9e25
parent 323497 333df199df73279ecb5b1243c9f6c4350a2f5250
child 323499 d91cd7bec1267e0ede7e8e809da730c3dff82f0e
push id30978
push usercbook@mozilla.com
push dateMon, 21 Nov 2016 14:44:46 +0000
treeherdermozilla-central@0534254e9a40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1318479
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1318479 part 5. Remove nsIDOMNode::AppendChild from TextTrackCue. r=ehsan
dom/base/DocumentFragment.h
dom/media/TextTrackCue.cpp
--- a/dom/base/DocumentFragment.h
+++ b/dom/base/DocumentFragment.h
@@ -35,16 +35,17 @@ private:
   }
 
 public:
   using FragmentOrElement::GetFirstChild;
   using nsINode::QuerySelector;
   using nsINode::QuerySelectorAll;
   // Make sure bindings can see our superclass' protected GetElementById method.
   using nsINode::GetElementById;
+  using nsINode::AppendChild;
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // interface nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // interface nsIDOMDocumentFragment
--- a/dom/media/TextTrackCue.cpp
+++ b/dom/media/TextTrackCue.cpp
@@ -131,22 +131,23 @@ TextTrackCue::GetCueAsHTML()
   nsPIDOMWindowInner* window = mDocument->GetInnerWindow();
   if (!window) {
     return mDocument->CreateDocumentFragment();
   }
 
   nsCOMPtr<nsIDOMHTMLElement> div;
   sParserWrapper->ConvertCueToDOMTree(window, this,
                                       getter_AddRefs(div));
-  if (!div) {
+  nsCOMPtr<nsINode> divNode = do_QueryInterface(div);
+  if (!divNode) {
     return mDocument->CreateDocumentFragment();
   }
   RefPtr<DocumentFragment> docFrag = mDocument->CreateDocumentFragment();
-  nsCOMPtr<nsIDOMNode> throwAway;
-  docFrag->AppendChild(div, getter_AddRefs(throwAway));
+  IgnoredErrorResult rv;
+  docFrag->AppendChild(*divNode, rv);
 
   return docFrag.forget();
 }
 
 void
 TextTrackCue::SetTrackElement(HTMLTrackElement* aTrackElement)
 {
   mTrackElement = aTrackElement;