diff --git a/dom/animation/AnimationPlayer.h b/dom/animation/AnimationPlayer.h index 94088afe167..a5dc500f940 100644 --- a/dom/animation/AnimationPlayer.h +++ b/dom/animation/AnimationPlayer.h @@ -321,8 +321,8 @@ protected: // Indicates whether we were in the finished state during our // most recent unthrottled sample (our last ComposeStyle call). bool mIsPreviousStateFinished; // Spec calls this "previous finished state" - // Indicates that the player should be exposed in an element's - // getAnimationPlayers() list. + // Indicates that the animation should be exposed in an element's + // getAnimations() list. bool mIsRelevant; }; diff --git a/dom/animation/test/chrome/test_animation_observers.html b/dom/animation/test/chrome/test_animation_observers.html index a3a1ca4b6b5..33cc888b696 100644 --- a/dom/animation/test/chrome/test_animation_observers.html +++ b/dom/animation/test/chrome/test_animation_observers.html @@ -141,7 +141,7 @@ function assert_record_list(actual, expected, desc, index, listName) { } for (var i = 0; i < actual.length; i++) { ok(actual.indexOf(expected[i]) != -1, - `${desc} - record[${index}].${listName} contains expected AnimationPlayer`); + `${desc} - record[${index}].${listName} contains expected Animation`); } } @@ -181,27 +181,27 @@ function assert_records(expected, desc) { // Register for the end of the transition. var transitionEnd = await_event(e, "transitionend"); - // The transition should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition start"); + // The transition should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after transition start"); // Advance until near the end of the transition, then wait for it to finish. - players[0].currentTime = 99900; + animations[0].currentTime = 99900; yield transitionEnd; - // After the transition has finished, the AnimationPlayer should disappear. - is(e.getAnimationPlayers().length, 0, "getAnimationPlayers().length after transition end"); + // After the transition has finished, the Animation should disappear. + is(e.getAnimations().length, 0, "getAnimations().length after transition end"); - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after transition end"); e.style = ""; @@ -214,23 +214,23 @@ function assert_records(expected, desc) { // Start a long transition. e.style = "transition: background-color 100s; background-color: lime;"; - // The transition should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition start"); + // The transition should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after transition start"); // Cancel the transition by setting transition-property. e.style.transitionProperty = "none"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after transition end"); e.style = ""; @@ -243,14 +243,14 @@ function assert_records(expected, desc) { // Start a long transition with a predictable value. e.style = "transition: background-color 100s steps(2, end) -51s; background-color: lime;"; - // The transition should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition start"); + // The transition should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after transition start"); // Cancel the transition by setting the current animation value. @@ -258,10 +258,10 @@ function assert_records(expected, desc) { is(getComputedStyle(e).backgroundColor, value, "half-way transition value"); e.style.backgroundColor = value; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after transition end"); e.style = ""; @@ -274,23 +274,23 @@ function assert_records(expected, desc) { // Start a long transition. e.style = "transition: line-height 100s; line-height: 100px;"; - // The transition should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition start"); + // The transition should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after transition start"); // Cancel the transition by setting line-height to a non-interpolable value. e.style.lineHeight = "normal"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after transition end"); e.style = ""; @@ -303,50 +303,50 @@ function assert_records(expected, desc) { // Start a long transition. e.style = "transition: background-color 100s step-start; background-color: lime;"; - // The transition should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition start"); + // The transition should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition start"); - var firstPlayer = players[0]; + var firstAnimation = animations[0]; - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: [firstPlayer], changed: [], removed: [] }], + assert_records([{ added: [firstAnimation], changed: [], removed: [] }], "records after transition start"); - // Wait for the AnimationPlayer to get going, then seek well into + // Wait for the Animation to get going, then seek well into // the transition. yield await_frame(); - firstPlayer.currentTime = 50000; + firstAnimation.currentTime = 50000; // Reverse the transition by setting the background-color back to its // original value. e.style.backgroundColor = "yellow"; - // The reversal should cause the creation of a new AnimationPlayer. - players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after transition reversal"); + // The reversal should cause the creation of a new Animation. + animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after transition reversal"); - var secondPlayer = players[0]; + var secondAnimation = animations[0]; - ok(firstPlayer != secondPlayer, - "second AnimationPlayer should be different from the first"); + ok(firstAnimation != secondAnimation, + "second Animation should be different from the first"); // Wait for the single MutationRecord for the removal of the original - // AnimationPlayer and the addition of the new AnimationPlayer to - // be delivered. + // Animation and the addition of the new Animation to be delivered. yield await_frame(); - assert_records([{ added: [secondPlayer], changed: [], removed: [firstPlayer] }], + assert_records([{ added: [secondAnimation], changed: [], + removed: [firstAnimation] }], "records after transition reversal"); // Cancel the transition. e.style.transitionProperty = "none"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: [secondPlayer] }], + assert_records([{ added: [], changed: [], removed: [secondAnimation] }], "records after transition end"); e.style = ""; @@ -360,45 +360,45 @@ function assert_records(expected, desc) { "transition-property: color, background-color, line-height; " + "color: blue; background-color: lime; line-height: 24px;"; - // The transitions should cause the creation of three AnimationPlayers. - var players = e.getAnimationPlayers(); - is(players.length, 3, "getAnimationPlayers().length after transition starts"); + // The transitions should cause the creation of three Animations. + var animations = e.getAnimations(); + is(animations.length, 3, "getAnimations().length after transition starts"); - // Wait for the single MutationRecord for the AnimationPlayer additions to + // Wait for the single MutationRecord for the Animation additions to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after transition starts"); - // Wait for the AnimationPlayers to get going, then seek well into + // Wait for the Animations to get going, then seek well into // the transitions. yield await_frame(); - players.forEach(p => p.currentTime = 50000); + animations.forEach(p => p.currentTime = 50000); - is(players.filter(p => p.playState == "running").length, 3, "number of running AnimationPlayers"); + is(animations.filter(p => p.playState == "running").length, 3, "number of running Animations"); // Cancel one of the transitions by setting transition-property. e.style.transitionProperty = "background-color, line-height"; - var colorPlayer = players.filter(p => p.playState != "running"); - var otherPlayers = players.filter(p => p.playState == "running"); + var colorAnimation = animations.filter(p => p.playState != "running"); + var otherAnimations = animations.filter(p => p.playState == "running"); - is(colorPlayer.length, 1, "number of non-running AnimationPlayers after cancelling one"); - is(otherPlayers.length, 2, "number of running AnimationPlayers after cancelling one"); + is(colorAnimation.length, 1, "number of non-running Animations after cancelling one"); + is(otherAnimations.length, 2, "number of running Animations after cancelling one"); - // Wait for a MutationRecord for one of the AnimationPlayer + // Wait for a MutationRecord for one of the Animation // removals to be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: colorPlayer }], + assert_records([{ added: [], changed: [], removed: colorAnimation }], "records after color transition end"); // Cancel the remaining transitions. e.style.transitionProperty = "none"; - // Wait for the MutationRecord for the other two AnimationPlayer + // Wait for the MutationRecord for the other two Animation // removals to be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: otherPlayers }], + assert_records([{ added: [], changed: [], removed: otherAnimations }], "records after other transition ends"); e.style = ""; @@ -413,27 +413,27 @@ function assert_records(expected, desc) { // Register for the end of the animation. var animationEnd = await_event(e, "animationend"); - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Advance until near the end of the animation, then wait for it to finish. - players[0].currentTime = 99900; + animations[0].currentTime = 99900; yield animationEnd; - // After the animation has finished, the AnimationPlayer should disappear. - is(e.getAnimationPlayers().length, 0, "getAnimationPlayers().length after animation end"); + // After the animation has finished, the Animation should disappear. + is(e.getAnimations().length, 0, "getAnimations().length after animation end"); - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -446,23 +446,23 @@ function assert_records(expected, desc) { // Start a long animation. e.style = "animation: anim 100s;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Cancel the animation by setting animation-name. e.style.animationName = "none"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -475,27 +475,27 @@ function assert_records(expected, desc) { // Start a long animation. e.style = "animation: anim 100s;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Advance the animation by a second. - players[0].currentTime += 1000; + animations[0].currentTime += 1000; // Cancel the animation by setting animation-duration to a value less // than a second. e.style.animationDuration = "0.1s"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -508,23 +508,23 @@ function assert_records(expected, desc) { // Start a long animation. e.style = "animation: anim 100s;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Cancel the animation by setting animation-delay. e.style.animationDelay = "-200s"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -540,18 +540,18 @@ function assert_records(expected, desc) { // Register for the end of the animation. var animationEnd = await_event(e, "animationend"); - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Advance until near the end of the animation, then wait for it to finish. - players[0].currentTime = 99900; + animations[0].currentTime = 99900; yield animationEnd; // No changes to the list of animations at this point. @@ -560,10 +560,10 @@ function assert_records(expected, desc) { // Cancel the animation by setting animation-fill-mode. e.style.animationFillMode = "none"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -576,18 +576,18 @@ function assert_records(expected, desc) { // Start a short, repeated animation. e.style = "animation: anim 0.5s infinite;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Advance the animation until we are past the first iteration. - players[0].currentTime += 1000; + animations[0].currentTime += 1000; // No changes to the list of animations at this point. assert_records([], "records after animation starts repeating"); @@ -595,10 +595,10 @@ function assert_records(expected, desc) { // Cancel the animation by setting animation-iteration-count. e.style.animationIterationCount = "1"; - // Wait for the single MutationRecord for the AnimationPlayer removal to + // Wait for the single MutationRecord for the Animation removal to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -618,23 +618,23 @@ function assert_records(expected, desc) { // Start a long animation. e.style = "animation: anim 100s;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Change a property of the animation such that it keeps running. e.style[aChangeTest.prop] = aChangeTest.val; - // Wait for the single MutationRecord for the AnimationPlayer change to + // Wait for the single MutationRecord for the Animation change to // be delivered. yield await_frame(); - assert_records([{ added: [], changed: players, removed: [] }], + assert_records([{ added: [], changed: animations, removed: [] }], "records after animation change"); // Cancel the animation. @@ -642,7 +642,7 @@ function assert_records(expected, desc) { // Wait for the addition, change and removal MutationRecords to be delivered. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -655,14 +655,14 @@ function assert_records(expected, desc) { // Start a long animation. e.style = "animation: anim 100s;"; - // The animation should cause the creation of a single AnimationPlayer. - var players = e.getAnimationPlayers(); - is(players.length, 1, "getAnimationPlayers().length after animation start"); + // The animation should cause the creation of a single Animation. + var animations = e.getAnimations(); + is(animations.length, 1, "getAnimations().length after animation start"); - // Wait for the single MutationRecord for the AnimationPlayer addition to + // Wait for the single MutationRecord for the Animation addition to // be delivered. yield await_frame(); - assert_records([{ added: players, changed: [], removed: [] }], + assert_records([{ added: animations, changed: [], removed: [] }], "records after animation start"); // Update the animation's delay such that it is still running. @@ -673,7 +673,7 @@ function assert_records(expected, desc) { // We should get a single removal notification. yield await_frame(); - assert_records([{ added: [], changed: [], removed: players }], + assert_records([{ added: [], changed: [], removed: animations }], "records after animation end"); e.style = ""; @@ -685,9 +685,9 @@ function assert_records(expected, desc) { // Start an animation that should already be finished. e.style = "animation: anim 1s -2s;"; - // The animation should cause no AnimationPlayers to be created. - var players = e.getAnimationPlayers(); - is(players.length, 0, "getAnimationPlayers().length after animation start"); + // The animation should cause no Animations to be created. + var animations = e.getAnimations(); + is(animations.length, 0, "getAnimations().length after animation start"); // And we should get no notifications. yield await_frame(); diff --git a/dom/animation/test/chrome/test_running_on_compositor.html b/dom/animation/test/chrome/test_running_on_compositor.html index e901f3349ef..8682a6c3059 100644 --- a/dom/animation/test/chrome/test_running_on_compositor.html +++ b/dom/animation/test/chrome/test_running_on_compositor.html @@ -42,21 +42,21 @@ var omtaEnabled = SpecialPowers.DOMWindowUtils.layerManagerRemote && // FIXME: When we implement Element.animate, use that here instead of CSS // so that we remove any dependency on the CSS mapping. div.style.animation = 'anim 100s'; -var player = div.getAnimationPlayers()[0]; +var animation = div.getAnimations()[0]; -player.ready.then(function() { - is(player.isRunningOnCompositor, omtaEnabled, - 'AnimationPlayer reports that it is running on the compositor' +animation.ready.then(function() { + is(animation.isRunningOnCompositor, omtaEnabled, + 'Animation reports that it is running on the compositor' + ' during playback'); div.style.animationPlayState = 'paused'; window.getComputedStyle(div).animationPlayState; // FIXME: When we implement deferred pausing (bug 1109390), we should wait - // on player.ready here. + // on animation.ready here. window.requestAnimationFrame(function() { - is(player.isRunningOnCompositor, false, - 'AnimationPlayer reports that it is NOT running on the compositor' + is(animation.isRunningOnCompositor, false, + 'Animation reports that it is NOT running on the compositor' + ' when paused'); SimpleTest.finish(); }); diff --git a/dom/animation/test/css-animations/test_animation-effect-name.html b/dom/animation/test/css-animations/test_animation-effect-name.html index 86f569957f5..7d8eb4a3035 100644 --- a/dom/animation/test/css-animations/test_animation-effect-name.html +++ b/dom/animation/test/css-animations/test_animation-effect-name.html @@ -15,21 +15,21 @@ test(function(t) { var div = addDiv(t); div.style.animation = 'xyz 100s'; - assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz', + assert_equals(div.getAnimations()[0].source.effect.name, 'xyz', 'Animation effect name matches keyframes rule name'); }, 'Effect name makes keyframe rule'); test(function(t) { var div = addDiv(t); div.style.animation = 'x\\yz 100s'; - assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz', + assert_equals(div.getAnimations()[0].source.effect.name, 'xyz', 'Escaped animation effect name matches keyframes rule name'); }, 'Escaped animation name'); test(function(t) { var div = addDiv(t); div.style.animation = 'x\\79 z 100s'; - assert_equals(div.getAnimationPlayers()[0].source.effect.name, 'xyz', + assert_equals(div.getAnimations()[0].source.effect.name, 'xyz', 'Hex-escaped animation effect name matches keyframes rule' + ' name'); }, 'Animation name with hex-escape'); diff --git a/dom/animation/test/css-animations/test_animation-pausing.html b/dom/animation/test/css-animations/test_animation-pausing.html index f34f52cc8e8..a4834532cad 100644 --- a/dom/animation/test/css-animations/test_animation-pausing.html +++ b/dom/animation/test/css-animations/test_animation-pausing.html @@ -22,17 +22,17 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); var previousAnimVal = getMarginLeft(cs); - player.ready.then(waitForFrame).then(t.step_func(function() { + animation.ready.then(waitForFrame).then(t.step_func(function() { assert_true(getMarginLeft(cs) > previousAnimVal, 'margin-left is initially increasing'); - player.pause(); - return player.ready; + animation.pause(); + return animation.ready; })).then(t.step_func(function() { previousAnimVal = getMarginLeft(cs); return waitForFrame(); @@ -48,14 +48,14 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s paused'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); - player.pause(); + animation.pause(); div.style.animationPlayState = 'running'; - player.ready.then(waitForFrame).then(t.step_func(function() { + animation.ready.then(waitForFrame).then(t.step_func(function() { assert_equals(cs.animationPlayState, 'running', 'animation-play-state is running'); assert_equals(getMarginLeft(cs), 0, @@ -69,14 +69,14 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s paused'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); - player.play(); + animation.play(); - player.ready.then(waitForFrame).then(t.step_func(function() { + animation.ready.then(waitForFrame).then(t.step_func(function() { assert_true(getMarginLeft(cs) > 0, 'Playing value of margin-left is greater than zero'); t.done(); @@ -88,15 +88,15 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s paused'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); - player.play(); + animation.play(); var previousAnimVal; - player.ready.then(function() { + animation.ready.then(function() { div.style.animationPlayState = 'running'; cs.animationPlayState; // Trigger style resolution return waitForFrame(); @@ -104,7 +104,7 @@ async_test(function(t) { assert_equals(cs.animationPlayState, 'running', 'animation-play-state is running'); div.style.animationPlayState = 'paused'; - return player.ready; + return animation.ready; })).then(t.step_func(function() { assert_equals(cs.animationPlayState, 'paused', 'animation-play-state is paused'); @@ -123,7 +123,7 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); @@ -131,10 +131,10 @@ async_test(function(t) { // apply the style changes first, they will ignore the redundant // call to play() and fail to correctly override the pause style. div.style.animationPlayState = 'paused'; - player.play(); + animation.play(); var previousAnimVal = getMarginLeft(cs); - player.ready.then(waitForFrame).then(t.step_func(function() { + animation.ready.then(waitForFrame).then(t.step_func(function() { assert_equals(cs.animationPlayState, 'paused', 'animation-play-state is paused'); assert_true(getMarginLeft(cs) > previousAnimVal, @@ -148,7 +148,7 @@ async_test(function(t) { var cs = window.getComputedStyle(div); div.style.animation = 'anim 1000s paused'; - var player = div.getAnimationPlayers()[0]; + var animation = div.getAnimations()[0]; assert_equals(getMarginLeft(cs), 0, 'Initial value of margin-left is zero'); @@ -163,10 +163,10 @@ async_test(function(t) { // For now this just serves as a sanity check that we do the same thing // even if we set style before calling the API. div.style.animationPlayState = 'running'; - player.pause(); + animation.pause(); var previousAnimVal = getMarginLeft(cs); - player.ready.then(waitForFrame).then(t.step_func(function() { + animation.ready.then(waitForFrame).then(t.step_func(function() { assert_equals(cs.animationPlayState, 'running', 'animation-play-state is running'); assert_equals(getMarginLeft(cs), previousAnimVal, diff --git a/dom/animation/test/css-animations/test_animation-player-currenttime.html b/dom/animation/test/css-animations/test_animation-player-currenttime.html index f644de1cc1e..44d5da7ae58 100644 --- a/dom/animation/test/css-animations/test_animation-player-currenttime.html +++ b/dom/animation/test/css-animations/test_animation-player-currenttime.html @@ -3,7 +3,7 @@ Tests for the effect of setting a CSS animation's - AnimationPlayer.currentTime + Animation.currentTime