From d8afcd19f3b51a8e25fbf93b22fd2ab78bfcc037 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 4 Jun 2018 01:44:39 -0700 Subject: [PATCH] Bug 1469769 - Part 2: animation: Replace failing NS_NOTREACHED with NS_ERROR. r=heycam I'm replacing non-failing calls to NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE, but this NS_NOTREACHED fails when running the devtools/client/animationinspector/test/browser_animation_refresh_on_removed_animation.js test. This assertion failure is bug 1189015. This patch DOES NOT fix the cause of the assertion failure (a missing TextNodeCorrespondenceProperty). It just replaces this failing NS_NOTREACHED with NS_ERROR because I can't replace with a fatal MOZ_ASSERT_UNREACHABLE. MozReview-Commit-ID: H5rfyr71N1M --HG-- extra : rebase_source : a65053171f41bc6069fc6cb3688c0a9cc36830b2 extra : intermediate-source : 203b3e7b091743faebcf58d576360d1afd85b6bc extra : source : 12dcc693259a536ac06075698db7e851d682cf3a --- dom/base/nsDOMMutationObserver.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index 3206ba0c7cf4..858f31f144cb 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -847,9 +847,14 @@ public: case eState_Removed: entry->mState = eState_RemainedPresent; break; - default: - NS_NOTREACHED("shouldn't have observed an animation being added " - "twice"); + case eState_Added: + // FIXME bug 1189015 + NS_ERROR("shouldn't have observed an animation being added twice"); + break; + case eState_RemainedPresent: + MOZ_ASSERT_UNREACHABLE("shouldn't have observed an animation " + "remaining present"); + break; } } else { entry = sCurrentBatch->AddEntry(aAnimation, aTarget); @@ -887,9 +892,14 @@ public: case eState_Added: entry->mState = eState_RemainedAbsent; break; - default: - NS_NOTREACHED("shouldn't have observed an animation being removed " - "twice"); + case eState_RemainedAbsent: + MOZ_ASSERT_UNREACHABLE("shouldn't have observed an animation " + "remaining absent"); + break; + case eState_Removed: + // FIXME bug 1189015 + NS_ERROR("shouldn't have observed an animation being removed twice"); + break; } } else { entry = sCurrentBatch->AddEntry(aAnimation, aTarget);