Bug 1311257 - Support missing keyframes handling for stylo. r=birtles

MozReview-Commit-ID: 1Iz6By2Y2Gp

--HG--
extra : rebase_source : 94dd3845c271e89f88dc7351b4cea179bd3bb2e5
This commit is contained in:
Hiroyuki Ikezoe 2017-04-06 10:34:51 +09:00
Родитель e432173483
Коммит 79052959a8
2 изменённых файлов: 4 добавлений и 20 удалений

Просмотреть файл

@ -439,11 +439,7 @@ KeyframeEffectReadOnly::CompositeValue(
CompositeOperation aCompositeOperation) CompositeOperation aCompositeOperation)
{ {
MOZ_ASSERT(mTarget, "CompositeValue should be called with target element"); MOZ_ASSERT(mTarget, "CompositeValue should be called with target element");
MOZ_ASSERT(!mDocument->IsStyledByServo());
// FIXME: Bug 1311257: Get the base value for the servo backend.
if (mDocument->IsStyledByServo()) {
return aValueToComposite;
}
StyleAnimationValue underlyingValue = StyleAnimationValue underlyingValue =
GetUnderlyingStyle(aProperty, aAnimationRule); GetUnderlyingStyle(aProperty, aAnimationRule);
@ -672,13 +668,6 @@ KeyframeEffectReadOnly::ComposeStyleRule(
// Bug 1329878 - Stylo: Implement accumulate and addition on Servo // Bug 1329878 - Stylo: Implement accumulate and addition on Servo
// AnimationValue. // AnimationValue.
// For unsupported or non-animatable animation types, we get nullptrs.
if (!aSegment.mFromValue.mServo|| !aSegment.mToValue.mServo) {
NS_ERROR("Compose style for unsupported or non-animatable property, "
"so get invalid RawServoAnimationValues");
return;
}
Servo_AnimationCompose(&aAnimationValues, Servo_AnimationCompose(&aAnimationValues,
&mBaseStyleValuesForServo, &mBaseStyleValuesForServo,
aProperty.mProperty, aProperty.mProperty,

Просмотреть файл

@ -469,9 +469,7 @@ KeyframeUtils::GetKeyframesFromObject(JSContext* aCx,
return keyframes; return keyframes;
} }
// FIXME: Bug 1311257: Support missing keyframes for Servo backend. if (!AnimationUtils::IsCoreAPIEnabled() &&
if ((!AnimationUtils::IsCoreAPIEnabled() ||
aDocument->IsStyledByServo()) &&
RequiresAdditiveAnimation(keyframes, aDocument)) { RequiresAdditiveAnimation(keyframes, aDocument)) {
keyframes.Clear(); keyframes.Clear();
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR); aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
@ -1444,8 +1442,6 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
return; return;
} }
bool isServoBackend = aDocument->IsStyledByServo();
// Create a set of keyframes for each property. // Create a set of keyframes for each property.
nsCSSParser parser(aDocument->CSSLoader()); nsCSSParser parser(aDocument->CSSLoader());
nsClassHashtable<nsFloatHashKey, Keyframe> processedKeyframes; nsClassHashtable<nsFloatHashKey, Keyframe> processedKeyframes;
@ -1458,9 +1454,8 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
// If we only have one value, we should animate from the underlying value // If we only have one value, we should animate from the underlying value
// using additive animation--however, we don't support additive animation // using additive animation--however, we don't support additive animation
// for Servo backend (bug 1311257) or when the core animation API pref is // when the core animation API pref is switched off.
// switched off. if ((!AnimationUtils::IsCoreAPIEnabled()) &&
if ((!AnimationUtils::IsCoreAPIEnabled() || isServoBackend) &&
count == 1) { count == 1) {
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR); aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
return; return;