Bug 1525145, remove harmless assertions by using IgnoredErrorResult, r=peterv
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 13 Feb 2019 22:51:10 +0200
changeset 458981 3dd87564278e
parent 458980 047455dcfc20
child 458982 89fc662c01ee
push id35553
push usershindli@mozilla.com
push dateThu, 14 Feb 2019 04:41:18 +0000
treeherdermozilla-central@f0ea53f47215 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1525145
milestone67.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 1525145, remove harmless assertions by using IgnoredErrorResult, r=peterv
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);
 }