Bug 1253507 - Disable Element.animate in Firefox 47; r=bz, r=pbro, a=ritu

MozReview-Commit-ID: CJm4SUEw832
This commit is contained in:
Brian Birtles 2016-03-17 13:07:41 +08:00
parent 77c95c8d4b
commit c868ca91dc
16 changed files with 24 additions and 150 deletions

View File

@ -48,13 +48,13 @@
document.querySelector(".css-transition").style.backgroundColor = "yellow";
}, 0);
document.querySelector(".script-animation").animate([
{opacity: 1, offset: 0},
{opacity: .1, offset: 1}
], {
duration: 10000,
fill: "forwards"
});
// Element.animate() is disabled in Firefox 47, so do it the long way.
let effect = new KeyframeEffect(document.querySelector(".script-animation"),
[ { opacity: 1, offset: 0 },
{ opacity: .1, offset: 1 } ],
{ duration: 10000, fill: "forwards" });
let animation = new Animation(effect, document.timeline);
animation.play();
</script>
</body>
</html>

View File

@ -3,11 +3,7 @@ support-files =
testcommon.js
../../imptests/testharness.js
../../imptests/testharnessreport.js
[chrome/test_animate_xrays.html]
# file_animate_xrays.html needs to go in mochitest.ini since it is served
# over HTTP
[chrome/test_animation_observers.html]
[chrome/test_animation_property_state.html]
[chrome/test_restyles.html]
[chrome/test_running_on_compositor.html]
skip-if = buildapp == 'b2g'

View File

@ -1470,47 +1470,6 @@ addAsyncAnimTest("tree_ordering", { observe: div, subtree: true }, function*() {
childB.remove();
});
addAsyncAnimTest("change_duration_and_currenttime",
{ observe: div, subtree: true }, function*() {
var anim = div.animate({ opacity: [ 0, 1 ] }, 100000);
yield await_frame();
assert_records([{ added: [anim], changed: [], removed: [] }],
"records after animation is added");
anim.effect.timing.duration = 10000;
yield await_frame();
assert_records([{ added: [], changed: [anim], removed: [] }],
"records after duration is changed");
anim.effect.timing.duration = 10000;
yield await_frame();
assert_records([], "records after assigning same value");
anim.currentTime = 50000;
yield await_frame();
assert_records([{ added: [], changed: [], removed: [anim] }],
"records after animation end");
anim.effect.timing.duration = 100000;
yield await_frame();
assert_records([{ added: [anim], changed: [], removed: [] }],
"records after animation restarted");
anim.effect.timing.duration = "auto";
yield await_frame();
assert_records([{ added: [], changed: [], removed: [anim] }],
"records after duration set \"auto\"");
anim.effect.timing.duration = "auto";
yield await_frame();
assert_records([], "records after assigning same value \"auto\"");
anim.cancel();
yield await_frame();
});
// Run the tests.
SimpleTest.requestLongerTimeout(2);
SimpleTest.waitForExplicitFinish();

View File

@ -345,27 +345,6 @@ waitForAllPaints(function() {
'update style when currentTime is set to middle of duration time');
yield ensureElementRemoval(div);
});
add_task_if_omta_enabled(function* change_duration_and_currenttime() {
var div = addDiv(null);
var animation = div.animate({ opacity: [ 0, 1 ] }, 10000);
yield animation.ready;
ok(animation.isRunningOnCompositor);
animation.currentTime = 50000;
ok(!animation.isRunningOnCompositor);
animation.effect.timing.duration = 100000;
var markers = yield observeStyling(5);
is(markers.length, 1,
'Animations running on the compositor should update style' +
'when timing.duration is made longer than the current time');
yield ensureElementRemoval(div);
});
});
</script>

View File

@ -285,48 +285,6 @@ promise_test(function(t) {
}, 'isRunningOnCompositor is true when a property that would otherwise block ' +
'running on the compositor is overridden in the CSS cascade');
promise_test(function(t) {
var div = addDiv(t);
var animation = div.animate({ opacity: [ 0, 1 ] }, 100000);
return animation.ready.then(t.step_func(function() {
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
'Animation reports that it is running on the compositor');
animation.currentTime = 50000;
animation.effect.timing.duration = 10000;
assert_equals(animation.isRunningOnCompositor, false,
'Animation reports that it is NOT running on the compositor'
+ ' when the animation is set a shorter duration than current time');
}));
}, 'animation is immediately removed from compositor' +
'when timing.duration is made shorter than the current time');
promise_test(function(t) {
var div = addDiv(t);
var animation = div.animate({ opacity: [ 0, 1 ] }, 10000);
return animation.ready.then(t.step_func(function() {
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
'Animation reports that it is running on the compositor');
animation.currentTime = 50000;
assert_equals(animation.isRunningOnCompositor, false,
'Animation reports that it is NOT running on the compositor'
+ ' when finished');
animation.effect.timing.duration = 100000;
return waitForFrame();
})).then(t.step_func(function() {
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
'Animation reports that it is running on the compositor'
+ ' when restarted');
}));
}, 'animation is added to compositor' +
' when timing.duration is made longer than the current time');
</script>
</script>
</body>

View File

@ -1,5 +1,4 @@
pref(dom.animations-api.core.enabled,true) load 1239889-1.html
pref(dom.animations-api.core.enabled,true) load 1244595-1.html
pref(dom.animations-api.core.enabled,true) load 1216842-1.html
pref(dom.animations-api.core.enabled,true) load 1216842-2.html
pref(dom.animations-api.core.enabled,true) load 1216842-3.html

View File

@ -16,7 +16,8 @@ dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
[NoInterfaceObject]
interface Animatable {
[Func="nsDocument::IsWebAnimationsEnabled", Throws]
// Bug 1253507: Disabled in Firefox 47 branch
[ChromeOnly, Throws]
Animation animate(object? frames,
optional (unrestricted double or KeyframeAnimationOptions)
options);

View File

@ -1 +0,0 @@
test-pref(dom.animations-api.core.enabled,true) == 1246046-1.html green-box.html

View File

@ -42,11 +42,7 @@ skip-if = toolkit == 'android'
[test_animations_async_tests.html]
support-files = ../../reftests/fonts/Ahem.ttf file_animations_async_tests.html
[test_animations_dynamic_changes.html]
[test_animations_effect_timing_duration.html]
support-files = file_animations_effect_timing_duration.html
[test_animations_event_order.html]
[test_animations_iterationstart.html]
support-files = file_animations_iterationstart.html
[test_animations_omta.html]
[test_animations_omta_start.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # bug 1041017

View File

@ -0,0 +1 @@
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -1,18 +1,3 @@
[duration.html]
type: testharness
[set duration auto]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1237173
[set duration -100]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1237173
[set duration abc]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1237173
[set duration string 100]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1237173
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -0,0 +1,3 @@
[getAnimations.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -0,0 +1,3 @@
[getComputedStyle.html]
type: testharness
disabled: bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -1,14 +1,3 @@
[effect-easing.html]
type: testharness
[steps(start) function]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1248532
[effect easing produces values greater than 1 with step-start keyframe]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1248532
[effect easing produces negative values with step-start keyframe]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1248532
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -0,0 +1,3 @@
[getComputedTiming-currentIteration.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748

View File

@ -0,0 +1,3 @@
[getComputedTiming-progress.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1245748