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
--- 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();