Bug 1352067 - Part 2: Avoid passing any nullptr into Servo_AnimationValue_DeepEqual.
The FFI type conversion in AnimationValue::as_arc will check if the
parameter is nullptr or not. If it is, we will get a debug assertion, so
we shouldn't pass a nullptr into it.
MozReview-Commit-ID: KWko2ipJwbo
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -5197,20 +5197,21 @@ StyleAnimationValue::operator==(const St
// AnimationValue Implementation
bool
AnimationValue::operator==(const AnimationValue& aOther) const
{
// It is possible to compare an empty AnimationValue with others, so both
// mServo and mGecko could be null while comparing.
MOZ_ASSERT(!mServo || mGecko.IsNull());
- if (mServo) {
+ if (mServo && aOther.mServo) {
return Servo_AnimationValue_DeepEqual(mServo, aOther.mServo);
}
- return mGecko == aOther.mGecko;
+ return !mServo && !aOther.mServo &&
+ mGecko == aOther.mGecko;
}
float
AnimationValue::GetOpacity() const
{
MOZ_ASSERT(!mServo != mGecko.IsNull());
return mServo ? Servo_AnimationValue_GetOpacity(mServo)
: mGecko.GetFloatValue();