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 458866 3dd87564278ec6eeebab2ebf633b92a21d58c113
parent 458865 047455dcfc2037b755cd2c23434f0b8767b7b352
child 458867 89fc662c01ee95a86213a20e89312b7925122bd4
push id111900
push useropettay@mozilla.com
push dateWed, 13 Feb 2019 20:52:16 +0000
treeherdermozilla-inbound@3dd87564278e [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);
 }