Bug 1330190 - Part 6: Add MOZ_DIAGNOSTIC_ASSERT for mIsComposing. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 16 Jan 2017 17:41:25 +0900
changeset 374542 8f52299c4c6366e7d1edfdd4f93aa3f7cfc4eb76
parent 374541 a2532fa6577d85c66c5cd6bea57c48db9a2a1c75
child 374543 aeda115ca5c37723ec703a2574204952001e40db
child 374565 359372e06f84b0ccd8f028929d1407c202f3d4b9
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1330190
milestone53.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 1330190 - Part 6: Add MOZ_DIAGNOSTIC_ASSERT for mIsComposing. r=birtles Based on the other changesets in this series, we don't expect to be calling UpdateProperties() and ComposeStyle() from within ComposeStyle() itself. However, in case there is some scenario where that does still occur, we leave the mIsComposing check in place and add an equivalent MOZ_DIAGNOSTIC_ASSERT so that we are alerted if this does occur on debug / Nightly / DevEdition builds, but handle it gracefully on beta or release builds. MozReview-Commit-ID: 2cFpyMFR29Q
dom/animation/KeyframeEffectReadOnly.cpp
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -272,16 +272,18 @@ SpecifiedKeyframeArraysAreEqual(const ns
 void
 KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aStyleContext);
 
   // Skip updating properties when we are composing style.
   // FIXME: Bug 1324966. Drop this check once we have a function to get
   // nsStyleContext without resolving animating style.
+  MOZ_DIAGNOSTIC_ASSERT(!mIsComposingStyle,
+                        "Should not be called while processing ComposeStyle()");
   if (mIsComposingStyle) {
     return;
   }
 
   nsTArray<AnimationProperty> properties = BuildProperties(aStyleContext);
 
   if (mProperties == properties) {
     return;
@@ -460,16 +462,18 @@ KeyframeEffectReadOnly::EnsureBaseStyles
   }
 }
 
 void
 KeyframeEffectReadOnly::ComposeStyle(
   RefPtr<AnimValuesStyleRule>& aStyleRule,
   const nsCSSPropertyIDSet& aPropertiesToSkip)
 {
+  MOZ_DIAGNOSTIC_ASSERT(!mIsComposingStyle,
+                        "Should not be called recursively");
   if (mIsComposingStyle) {
     return;
   }
 
   AutoRestore<bool> isComposingStyle(mIsComposingStyle);
   mIsComposingStyle = true;
 
   ComputedTiming computedTiming = GetComputedTiming();