Animation.idl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #import <Animations/AnimationEffect.idl>
  2. #import <Animations/AnimationTimeline.idl>
  3. #import <DOM/EventTarget.idl>
  4. // https://www.w3.org/TR/web-animations-1/#the-animation-interface
  5. [Exposed=Window]
  6. interface Animation : EventTarget {
  7. constructor(optional AnimationEffect? effect = null,
  8. [ExplicitNull] optional AnimationTimeline? timeline);
  9. attribute DOMString id;
  10. attribute AnimationEffect? effect;
  11. attribute AnimationTimeline? timeline;
  12. attribute double? startTime;
  13. attribute double? currentTime;
  14. attribute double playbackRate;
  15. readonly attribute AnimationPlayState playState;
  16. readonly attribute AnimationReplaceState replaceState;
  17. readonly attribute boolean pending;
  18. readonly attribute Promise<Animation> ready;
  19. readonly attribute Promise<Animation> finished;
  20. attribute EventHandler onfinish;
  21. attribute EventHandler oncancel;
  22. attribute EventHandler onremove;
  23. undefined cancel();
  24. undefined finish();
  25. undefined play();
  26. undefined pause();
  27. undefined updatePlaybackRate(double playbackRate);
  28. undefined reverse();
  29. undefined persist();
  30. // FIXME: [CEReactions] undefined commitStyles();
  31. };
  32. // https://www.w3.org/TR/web-animations-1/#the-animationplaystate-enumeration
  33. enum AnimationPlayState { "idle", "running", "paused", "finished" };
  34. // https://www.w3.org/TR/web-animations-1/#the-animationreplacestate-enumeration
  35. enum AnimationReplaceState { "active", "removed", "persisted" };