Bug 1525145 - remove harmless assertions by using IgnoredErrorResult. r=peterv, a=jcristau DEVEDITION_66_0b9_BUILD1 DEVEDITION_66_0b9_RELEASE FENNEC_66_0b9_BUILD1 FENNEC_66_0b9_RELEASE FIREFOX_66_0b9_BUILD1 FIREFOX_66_0b9_RELEASE
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 13 Feb 2019 22:51:10 +0200
changeset 513136 bce0092f646c52d0402531a5b5a860905dfe7ad8
parent 513135 1d2492f5e16c30063ffe410223d604776caa0ad1
child 513137 790919348c16b0769829809288b2d1011dbfb2f7
push id10725
push userjcristau@mozilla.com
push dateMon, 18 Feb 2019 13:13:12 +0000
treeherdermozilla-beta@bce0092f646c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, jcristau
bugs1525145
milestone66.0
Bug 1525145 - remove harmless assertions by using IgnoredErrorResult. r=peterv, a=jcristau
dom/html/HTMLTableElement.cpp
dom/html/HTMLTableSectionElement.cpp
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -584,21 +584,20 @@ already_AddRefed<nsGenericHTMLElement> H
     }
 
     nsINode::InsertBefore(*head, refNode, IgnoreErrors());
   }
   return head.forget();
 }
 
 void HTMLTableElement::DeleteTHead() {
-  HTMLTableSectionElement* tHead = GetTHead();
+  RefPtr<HTMLTableSectionElement> tHead = GetTHead();
   if (tHead) {
-    mozilla::ErrorResult rv;
+    mozilla::IgnoredErrorResult rv;
     nsINode::RemoveChild(*tHead, rv);
-    MOZ_ASSERT(!rv.Failed());
   }
 }
 
 already_AddRefed<nsGenericHTMLElement> HTMLTableElement::CreateTFoot() {
   RefPtr<nsGenericHTMLElement> foot = GetTFoot();
   if (!foot) {
     // create a new foot rowgroup
     RefPtr<mozilla::dom::NodeInfo> nodeInfo;
@@ -611,21 +610,20 @@ already_AddRefed<nsGenericHTMLElement> H
     }
     AppendChildTo(foot, true);
   }
 
   return foot.forget();
 }
 
 void HTMLTableElement::DeleteTFoot() {
-  HTMLTableSectionElement* tFoot = GetTFoot();
+  RefPtr<HTMLTableSectionElement> tFoot = GetTFoot();
   if (tFoot) {
-    mozilla::ErrorResult rv;
+    mozilla::IgnoredErrorResult rv;
     nsINode::RemoveChild(*tFoot, rv);
-    MOZ_ASSERT(!rv.Failed());
   }
 }
 
 already_AddRefed<nsGenericHTMLElement> HTMLTableElement::CreateCaption() {
   RefPtr<nsGenericHTMLElement> caption = GetCaption();
   if (!caption) {
     // Create a new caption.
     RefPtr<mozilla::dom::NodeInfo> nodeInfo;
@@ -639,21 +637,20 @@ already_AddRefed<nsGenericHTMLElement> H
 
     nsCOMPtr<nsINode> firsChild = nsINode::GetFirstChild();
     nsINode::InsertBefore(*caption, firsChild, IgnoreErrors());
   }
   return caption.forget();
 }
 
 void HTMLTableElement::DeleteCaption() {
-  HTMLTableCaptionElement* caption = GetCaption();
+  RefPtr<HTMLTableCaptionElement> caption = GetCaption();
   if (caption) {
-    mozilla::ErrorResult rv;
+    mozilla::IgnoredErrorResult rv;
     nsINode::RemoveChild(*caption, rv);
-    MOZ_ASSERT(!rv.Failed());
   }
 }
 
 already_AddRefed<nsGenericHTMLElement> HTMLTableElement::CreateTBody() {
   RefPtr<mozilla::dom::NodeInfo> nodeInfo =
       OwnerDoc()->NodeInfoManager()->GetNodeInfo(
           nsGkAtoms::tbody, nullptr, kNameSpaceID_XHTML, ELEMENT_NODE);
   MOZ_ASSERT(nodeInfo);
--- a/dom/html/HTMLTableSectionElement.cpp
+++ b/dom/html/HTMLTableSectionElement.cpp
@@ -100,17 +100,17 @@ void HTMLTableSectionElement::DeleteRow(
       return;
     }
 
     --refIndex;
   } else {
     refIndex = (uint32_t)aValue;
   }
 
-  nsINode* row = rows->Item(refIndex);
+  nsCOMPtr<nsINode> row = rows->Item(refIndex);
   if (!row) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return;
   }
 
   nsINode::RemoveChild(*row, aError);
 }