Bug 1311620 - Part 2: Don't call StyleAnimationValue::GetUnit() against uninitialized values, use IsNull() instead. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Sat, 24 Dec 2016 17:26:50 +0900
changeset 453695 3c3e0aa691c22e9cebf79f12abe6a61c8a560179
parent 453694 348fbd4dc0dd5c54980d2e5d96e2d297672e2217
child 453696 2deb9f1c3fffb3a4c849038d6e78a1191c835141
push id39729
push userhiikezoe@mozilla-japan.org
push dateSat, 24 Dec 2016 11:23:17 +0000
reviewersbirtles
bugs1311620
milestone53.0a1
Bug 1311620 - Part 2: Don't call StyleAnimationValue::GetUnit() against uninitialized values, use IsNull() instead. r?birtles MozReview-Commit-ID: JAcHqsgpdDB
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -584,19 +584,18 @@ struct StyleAnimationValueCompositePair 
 static StyleAnimationValue
 SampleValue(float aPortion, const Animation& aAnimation,
             const StyleAnimationValueCompositePair& aStart,
             const StyleAnimationValueCompositePair& aEnd,
             const StyleAnimationValue& aLastValue,
             uint64_t aCurrentIteration,
             const StyleAnimationValue& aUnderlyingValue)
 {
-  NS_ASSERTION(aStart.mValue.GetUnit() == aEnd.mValue.GetUnit() ||
-               aStart.mValue.GetUnit() == StyleAnimationValue::eUnit_None ||
-               aEnd.mValue.GetUnit() == StyleAnimationValue::eUnit_None,
+  NS_ASSERTION(aStart.mValue.IsNull() || aEnd.mValue.IsNull() ||
+               aStart.mValue.GetUnit() == aEnd.mValue.GetUnit(),
                "Must have same unit");
 
   StyleAnimationValue startValue =
     dom::KeyframeEffectReadOnly::CompositeValue(aAnimation.property(),
                                                 aStart.mValue,
                                                 aUnderlyingValue,
                                                 aStart.mComposite);
   StyleAnimationValue endValue =