Bug 1457813 - Part 1: Replace asserting NS_PRECONDITIONs with NS_ASSERTIONs. r?froydnj draft
authorChris Peterson <cpeterson@mozilla.com>
Sun, 05 Nov 2017 17:01:56 -0800
changeset 790927 d35d23c2ce73d431889ceb9b841c94d6a5b1be9f
parent 790873 2d83e1843241d869a2fc5cf06f96d3af44c70e70
child 790928 3445d700a73bdbf8596c28f04ce862e5657d39e9
push id108649
push usercpeterson@mozilla.com
push dateThu, 03 May 2018 06:11:06 +0000
reviewersfroydnj
bugs1457813
milestone61.0a1
Bug 1457813 - Part 1: Replace asserting NS_PRECONDITIONs with NS_ASSERTIONs. r?froydnj MozReview-Commit-ID: JMNmdne85lg
dom/base/nsIContentInlines.h
layout/base/PresShell.cpp
--- a/dom/base/nsIContentInlines.h
+++ b/dom/base/nsIContentInlines.h
@@ -28,18 +28,20 @@ nsIContent::IsInChromeDocument() const
 {
   return nsContentUtils::IsChromeDoc(OwnerDoc());
 }
 
 inline void
 nsIContent::SetPrimaryFrame(nsIFrame* aFrame)
 {
   MOZ_ASSERT(IsInUncomposedDoc() || IsInShadowTree(), "This will end badly!");
-  NS_PRECONDITION(!aFrame || !mPrimaryFrame || aFrame == mPrimaryFrame,
-                  "Losing track of existing primary frame");
+
+  // FIXME <map> bug 749326
+  NS_ASSERTION(!aFrame || !mPrimaryFrame || aFrame == mPrimaryFrame,
+               "Losing track of existing primary frame");
 
   if (aFrame) {
     if (MOZ_LIKELY(!IsHTMLElement(nsGkAtoms::area)) ||
         aFrame->GetContent() == this) {
       aFrame->SetIsPrimaryFrame(true);
     }
   } else if (nsIFrame* currentPrimaryFrame = GetPrimaryFrame()) {
     if (MOZ_LIKELY(!IsHTMLElement(nsGkAtoms::area)) ||
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -2676,20 +2676,23 @@ void
 PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
                             nsFrameState aBitToAdd,
                             ReflowRootHandling aRootHandling)
 {
   NS_PRECONDITION(aBitToAdd == NS_FRAME_IS_DIRTY ||
                   aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN ||
                   !aBitToAdd,
                   "Unexpected bits being added");
-  NS_PRECONDITION(!(aIntrinsicDirty == eStyleChange &&
-                    aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN),
-                  "bits don't correspond to style change reason");
-
+
+  // FIXME removeAttribute bug 478135
+  NS_ASSERTION(!(aIntrinsicDirty == eStyleChange &&
+                 aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN),
+               "bits don't correspond to style change reason");
+
+  // FIXME bug 457400
   NS_ASSERTION(!mIsReflowing, "can't mark frame dirty during reflow");
 
   // If we've not yet done the initial reflow, then don't bother
   // enqueuing a reflow command yet.
   if (! mDidInitialize)
     return;
 
   // If we're already destroying, don't bother with this either.