Bug 1298571 - Fix for review comments r?hiro
* change test case name from unnecessary_update_is_not_invoked to no_restyling_when_animation_style_when_re_setting_same_animation_property
* use add_task_if_omta_enabled instead of add_task
* Add some comments
* Remove bug number from test message
MozReview-Commit-ID: FXjYHD2kwWm
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -689,40 +689,41 @@ waitForAllPaints(function() {
is(markers.length, 1,
'Setting an empty set of keyframes should trigger a single restyle ' +
'to remove the previous animated style');
yield ensureElementRemoval(div);
});
- add_task(function* unnecessary_update_is_not_invoked() {
- var div = addDiv(null, { style: 'animation: opacity 10s' });
+ add_task_if_omta_enabled(function* no_restyling_when_animation_style_when_re_setting_same_animation_property() {
+ var div = addDiv(null, { style: 'animation: opacity 100s' });
var animation = div.getAnimations()[0];
yield animation.ready;
- yield waitForAnimationFrames(5);
- div.style.animation = 'opacity 10s';
+ ok(animation.isRunningOnCompositor);
+ // Apply the same animation style
+ div.style.animation = 'opacity 100s';
var markers = yield observeStyling(5);
is(markers.length, 0,
- 'Bug 1293806: Applying same animation style ' +
+ 'Applying same animation style ' +
'should never cause restyles');
yield ensureElementRemoval(div);
});
add_task(function* necessary_update_should_be_invoked() {
var div = addDiv(null, { style: 'animation: background-color 10s' });
var animation = div.getAnimations()[0];
yield animation.ready;
yield waitForAnimationFrames(5);
+ // Apply another animation style
div.style.animation = 'background-color 8s';
var animation = div.getAnimations()[0];
- yield animation.ready;
var markers = yield observeStyling(5);
is(markers.length, 5,
- 'Bug 1293806: Applying animation style with different duration ' +
- 'should cause restyles');
+ 'Applying animation style with different duration ' +
+ 'should cause restyles on every frame.');
yield ensureElementRemoval(div);
});
});
</script>
</body>