-
Notifications
You must be signed in to change notification settings - Fork 747
Description
There is a WPT test added in web-platform-tests/wpt@90f237a which does the following:
promise_test(t => {
let anim;
return getXHRDoc(t).then(xhrdoc => {
const div = xhrdoc.getElementById('test');
anim = div.animate(null);
anim.timeline = document.timeline;
assert_true(anim.pending, 'The animation should be initially pending');
return waitForAnimationFrames(2);
}).then(() => {
// Because the element is in a document without a browsing context, it will
// not be rendered and hence the user agent will never deem it ready to
// animate.
assert_true(anim.pending,
'The animation should still be pending after replacing'
+ ' the document timeline');
});
}, 'Replacing the timeline of an animation targetting an element in a'
+ ' document without a browsing context leaves it in the pending state');
At the time of wring, only Firefox passes that test because both Safari and Chrome resolve the ready
promise for this element, likely because it is associated with a timeline that is associated with a document with a browsing context.
However, the Web Animations spec does not mention the notion of a browsing context once. This comment in the test:
// Because the element is in a document without a browsing context, it will
// not be rendered and hence the user agent will never deem it ready to
// animate.
… very likely refers to this spec text about being ready:
An animation is ready at the first moment where both of the following conditions are true:
the user agent has completed any setup required to begin the playback of the animation’s associated effect including rendering the first frame of any keyframe effect.
But I think this definition is too vague to infer that an animation targeting an element that is in a document without a browsing context should not be in the ready state. For instance, is an element with display: none
able to render its first frame?
I think we need to clarify what impact the availability of a browsing context has on an animation's ready state.
Assigning this to @birtles as the author of this test, also cc'ing @flackr.