Skip to content

Animation

Generated from idl/web-animations.webidl when the site was built at 7aa23e2.

Animation is an interface in idl/web-animations.webidl, inheriting EventTarget, exposed in Window. What it does is on MDN; this page says what niso has of it.

The ready and finished promises cross as (generation, state) pairs: the glue makes a promise per generation and settles it when the hook reports that generation settled.

The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).

Feature On the web In niso Members
Web animations Widely available Partial 91% 3301 of 3589 subtests pass 24
constructor
[NisoGlue] constructor(optional AnimationEffect? effect = null, optional AnimationTimeline? timeline);
attribute
attribute DOMString id;
int32_t niso_animation_get_id(niso_dom* dom, niso_handle self, niso_str* out);
int32_t niso_animation_set_id(niso_dom* dom, niso_handle self, const char* value, size_t value_len);
attribute
attribute AnimationEffect? effect;
int32_t niso_animation_get_effect(niso_dom* dom, niso_handle self, niso_handle* out);
int32_t niso_animation_set_effect(niso_dom* dom, niso_handle self, niso_handle value);
attribute
attribute AnimationTimeline? timeline;
int32_t niso_animation_get_timeline(niso_dom* dom, niso_handle self, niso_handle* out);
int32_t niso_animation_set_timeline(niso_dom* dom, niso_handle self, niso_handle value);
attribute
[NisoGlue] attribute double? startTime;
attribute
[NisoGlue] attribute double? currentTime;
attribute
attribute double playbackRate;
int32_t niso_animation_get_playback_rate(niso_dom* dom, niso_handle self, double* out);
int32_t niso_animation_set_playback_rate(niso_dom* dom, niso_handle self, double value);
attribute
readonly attribute AnimationPlayState playState;
int32_t niso_animation_get_play_state(niso_dom* dom, niso_handle self, niso_str* out);
attribute
readonly attribute AnimationReplaceState replaceState;
int32_t niso_animation_get_replace_state(niso_dom* dom, niso_handle self, niso_str* out);
attribute
readonly attribute boolean pending;
int32_t niso_animation_get_pending(niso_dom* dom, niso_handle self, bool* out);
attribute
[NisoGlue] readonly attribute Promise<Animation> ready;
attribute
[NisoGlue] readonly attribute Promise<Animation> finished;
attribute
attribute EventHandler onfinish;
int32_t niso_animation_get_onfinish(niso_dom* dom, niso_handle self, void** out);
int32_t niso_animation_set_onfinish(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);
attribute
attribute EventHandler oncancel;
int32_t niso_animation_get_oncancel(niso_dom* dom, niso_handle self, void** out);
int32_t niso_animation_set_oncancel(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);
attribute
attribute EventHandler onremove;
int32_t niso_animation_get_onremove(niso_dom* dom, niso_handle self, void** out);
int32_t niso_animation_set_onremove(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);
operation
undefined cancel();
int32_t niso_animation_cancel(niso_dom* dom, niso_handle self);
operation
undefined finish();
int32_t niso_animation_finish(niso_dom* dom, niso_handle self);
operation
undefined play();
int32_t niso_animation_play(niso_dom* dom, niso_handle self);
operation
undefined pause();
int32_t niso_animation_pause(niso_dom* dom, niso_handle self);
operation
undefined updatePlaybackRate(double playbackRate);
int32_t niso_animation_update_playback_rate(niso_dom* dom, niso_handle self, double playback_rate);
operation
undefined reverse();
int32_t niso_animation_reverse(niso_dom* dom, niso_handle self);
operation
undefined persist();
int32_t niso_animation_persist(niso_dom* dom, niso_handle self);
operation
[CEReactions] undefined commitStyles();
int32_t niso_animation_commit_styles(niso_dom* dom, niso_handle self);
static operation not in JS
[NisoInternal] static Animation create(AnimationEffect? effect, AnimationTimeline? timeline, boolean defaultTimeline);
int32_t niso_animation_create(niso_dom* dom, niso_handle effect, niso_handle timeline, bool default_timeline, niso_handle* out);
operation not in JS
[NisoInternal] unrestricted double startTimeValue();
int32_t niso_animation_start_time_value(niso_dom* dom, niso_handle self, double* out);
operation not in JS
[NisoInternal] undefined setStartTimeValue(unrestricted double time);
int32_t niso_animation_set_start_time_value(niso_dom* dom, niso_handle self, double time);
operation not in JS
[NisoInternal] unrestricted double currentTimeValue();
int32_t niso_animation_current_time_value(niso_dom* dom, niso_handle self, double* out);
operation not in JS
[NisoInternal] undefined setCurrentTimeValue(unrestricted double time);
int32_t niso_animation_set_current_time_value(niso_dom* dom, niso_handle self, double time);
operation not in JS
[NisoInternal] unsigned long promiseState(boolean finished);
int32_t niso_animation_promise_state(niso_dom* dom, niso_handle self, bool finished, uint32_t* out);

The current ready (or finished) promise’s generation times four, plus 0 while it is pending, 1 once fulfilled and 2 once rejected.

static operation not in JS
[NisoInternal] static undefined setPromiseHook(AnimationPromiseCallback hook);
int32_t niso_animation_set_promise_hook(niso_dom* dom, niso_animation_promise_callback_fn hook_fn, void* hook_userdata, niso_drop_fn hook_drop);

Members the web has, by the BCD keys web-features 3.45.0 lists, that idl/ doesn’t declare. The list is partial: web-features lists only the keys it maps to a feature.

  • remove_filling_animation (Web animations)