Bug 1278430 - Update the first keyframe value as well as property value when replacing transition. r=birtles

MozReview-Commit-ID: teNZdJdKoy

--HG--
extra : rebase_source : 88589ef8cea26e86c43eb9fa4c403a3cad17f09b
This commit is contained in:
Hiroyuki Ikezoe 2016-06-08 06:25:46 +09:00
Родитель 607fdf944b
Коммит 0fd4b861ca
2 изменённых файлов: 21 добавлений и 4 удалений

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

@ -105,6 +105,18 @@ ElementPropertyTransition::UpdateStartValueFromReplacedTransition()
mProperties[0].mSegments.Length() == 1,
"The transition should have one property and one segment");
mProperties[0].mSegments[0].mFromValue = Move(startValue);
nsCSSValue cssValue;
DebugOnly<bool> uncomputeResult =
StyleAnimationValue::UncomputeValue(mProperties[0].mProperty,
startValue,
cssValue);
MOZ_ASSERT(uncomputeResult, "UncomputeValue should not fail");
MOZ_ASSERT(mKeyframes.Length() == 2,
"Transitions should have exactly two animation keyframes");
MOZ_ASSERT(mKeyframes[0].mPropertyValues.Length() == 1,
"Transitions should have exactly one property in their first "
"frame");
mKeyframes[0].mPropertyValues[0].mValue = cssValue;
}
}

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

@ -47,7 +47,8 @@ window.addEventListener("load", function() {
// Wait for a paint to ensure that the first transition has started.
waitForAllPaints(function() {
var previousMatrix;
var previousPropertyValue;
var previousKeyframeValue;
var anim;
requestAnimationFrame(function() {
// Start second transition
@ -56,7 +57,8 @@ window.addEventListener("load", function() {
anim = div.getAnimations()[0];
var properties = SpecialPowers.wrap(anim.effect).getProperties();
previousMatrix = properties[0].values[0].value;
previousPropertyValue = properties[0].values[0].value;
previousKeyframeValue = anim.effect.getKeyframes()[0].transform;
});
requestAnimationFrame(function() {
@ -73,10 +75,13 @@ window.addEventListener("load", function() {
// process that we update the transition start point).
waitForAllPaints(function() {
var properties = SpecialPowers.wrap(anim.effect).getProperties();
var currentMatrix = properties[0].values[0].value;
isnot(currentMatrix, previousMatrix,
var currentPropertyValue = properties[0].values[0].value;
isnot(currentPropertyValue, previousPropertyValue,
"From value of transition is updated since the moment when " +
"it was generated");
isnot(anim.effect.getKeyframes()[0].transform, previousKeyframeValue,
"Keyframe value of transition is updated since the moment when " +
"it was generated");
finish();
});
});