Bug 1633442 - Check the current keyframe's properties instead of checking mTransitionProperty. r=boris

Since mTransitionProperty keep holding the original transition property even if
the target effect or keyframe was replaced by others. We need to make sure the
current transition is runnable on the compositor, i.e. having the effect and
keyframes and one of the properties is runnable on the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D73586
This commit is contained in:
Hiroyuki Ikezoe 2020-05-05 01:29:44 +00:00
Родитель 4fa1b411fd
Коммит cff00579e3
3 изменённых файлов: 23 добавлений и 14 удалений

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

@ -0,0 +1,15 @@
<!doctype html>
<html class="reftest-wait">
<head>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.documentElement.style.setProperty('transition-duration', '3s', '')
document.documentElement.style.setProperty('rotate', '2deg', undefined)
document.documentElement.style.setProperty('-moz-outline-radius-topleft', '2%', '')
const [anim_1, anim_0] = document.documentElement.getAnimations({})
anim_1.effect = anim_0.effect
document.documentElement.classList.remove("reftest-wait");
})
</script>
</head>
</html>

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

@ -50,4 +50,5 @@ pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.getAnimations
pref(dom.animations-api.core.enabled,true) load 1612891-1.html
pref(dom.animations-api.core.enabled,true) load 1612891-2.html
pref(dom.animations-api.core.enabled,true) load 1612891-3.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.getAnimations.enabled,true) load 1633442.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.implicit-keyframes.enabled,true) load 1633486.html

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

@ -312,10 +312,11 @@ double CSSTransition::CurrentValuePortion() const {
}
void CSSTransition::UpdateStartValueFromReplacedTransition() {
MOZ_ASSERT(nsCSSProps::PropHasFlags(mTransitionProperty,
CSSPropFlags::CanAnimateOnCompositor),
"The transition property should be able to be run on the "
"compositor");
MOZ_ASSERT(mEffect && mEffect->AsKeyframeEffect() &&
mEffect->AsKeyframeEffect()->HasAnimationOfPropertySet(
nsCSSPropertyIDSet::CompositorAnimatables()),
"Should be called for compositor-runnable transitions");
MOZ_ASSERT(mTimeline,
"Should have a timeline if we are replacing transition start "
"values");
@ -324,15 +325,6 @@ void CSSTransition::UpdateStartValueFromReplacedTransition() {
return;
}
if (!mEffect) {
return;
}
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (!keyframeEffect) {
return;
}
ComputedTiming computedTiming = AnimationEffect::GetComputedTimingAt(
CSSTransition::GetCurrentTimeAt(*mTimeline, TimeStamp::Now(),
mReplacedTransition->mStartTime,
@ -352,7 +344,8 @@ void CSSTransition::UpdateStartValueFromReplacedTransition() {
replacedTo.mServo, valuePosition)
.Consume();
keyframeEffect->ReplaceTransitionStartValue(std::move(startValue));
mEffect->AsKeyframeEffect()->ReplaceTransitionStartValue(
std::move(startValue));
}
mReplacedTransition.reset();