blob: a958bc84c0ffaec8df5c217286d36ad546742952 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:05 +00001// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: Web Animations (https://drafts.csswg.org/web-animations-1/)
5
6[Exposed=Window]
7interface AnimationTimeline {
8 readonly attribute double? currentTime;
9 readonly attribute TimelinePhase phase;
10};
11
12dictionary DocumentTimelineOptions {
13 DOMHighResTimeStamp originTime = 0;
14};
15
16[Exposed=Window]
17interface DocumentTimeline : AnimationTimeline {
18 constructor(optional DocumentTimelineOptions options = {});
19};
20
21[Exposed=Window]
22interface Animation : EventTarget {
23 constructor(optional AnimationEffect? effect = null,
24 optional AnimationTimeline? timeline);
25 attribute DOMString id;
26 attribute AnimationEffect? effect;
27 attribute AnimationTimeline? timeline;
28 attribute double playbackRate;
29 readonly attribute AnimationPlayState playState;
30 readonly attribute AnimationReplaceState replaceState;
31 readonly attribute boolean pending;
32 readonly attribute Promise<Animation> ready;
33 readonly attribute Promise<Animation> finished;
34 attribute EventHandler onfinish;
35 attribute EventHandler oncancel;
36 attribute EventHandler onremove;
37 undefined cancel();
38 undefined finish();
39 undefined play();
40 undefined pause();
41 undefined updatePlaybackRate(double playbackRate);
42 undefined reverse();
43 undefined persist();
44 undefined commitStyles();
45};
46
47enum AnimationPlayState { "idle", "running", "paused", "finished" };
48
49enum AnimationReplaceState { "active", "removed", "persisted" };
50
51enum TimelinePhase { "inactive", "before", "active", "after" };
52
53[Exposed=Window]
54interface AnimationEffect {
55 EffectTiming getTiming();
56 ComputedEffectTiming getComputedTiming();
57 undefined updateTiming(optional OptionalEffectTiming timing = {});
58};
59
60dictionary EffectTiming {
61 double delay = 0;
62 double endDelay = 0;
63 FillMode fill = "auto";
64 double iterationStart = 0.0;
65 unrestricted double iterations = 1.0;
66 PlaybackDirection direction = "normal";
67 DOMString easing = "linear";
68};
69
70dictionary OptionalEffectTiming {
71 double delay;
72 double endDelay;
73 FillMode fill;
74 double iterationStart;
75 unrestricted double iterations;
76 (unrestricted double or DOMString) duration;
77 PlaybackDirection direction;
78 DOMString easing;
79};
80
81enum FillMode { "none", "forwards", "backwards", "both", "auto" };
82
83enum PlaybackDirection { "normal", "reverse", "alternate", "alternate-reverse" };
84
85dictionary ComputedEffectTiming : EffectTiming {
86 double? progress;
87 unrestricted double? currentIteration;
88};
89
90[Exposed=Window]
91interface KeyframeEffect : AnimationEffect {
92 constructor(Element? target,
93 object? keyframes,
94 optional (unrestricted double or KeyframeEffectOptions) options = {});
95 constructor(KeyframeEffect source);
96 attribute Element? target;
97 attribute CSSOMString? pseudoElement;
98 attribute CompositeOperation composite;
99 sequence<object> getKeyframes();
100 undefined setKeyframes(object? keyframes);
101};
102
103dictionary BaseComputedKeyframe {
104 double? offset = null;
105 double computedOffset;
106 DOMString easing = "linear";
107 CompositeOperationOrAuto composite = "auto";
108};
109
110dictionary BasePropertyIndexedKeyframe {
111 (double? or sequence<double?>) offset = [];
112 (DOMString or sequence<DOMString>) easing = [];
113 (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = [];
114};
115
116dictionary BaseKeyframe {
117 double? offset = null;
118 DOMString easing = "linear";
119 CompositeOperationOrAuto composite = "auto";
120};
121
122dictionary KeyframeEffectOptions : EffectTiming {
123 CompositeOperation composite = "replace";
124 CSSOMString? pseudoElement = null;
125};
126
127enum CompositeOperation { "replace", "add", "accumulate" };
128
129enum CompositeOperationOrAuto { "replace", "add", "accumulate", "auto" };
130
131interface mixin Animatable {
132 Animation animate(object? keyframes,
133 optional (unrestricted double or KeyframeAnimationOptions) options = {});
134 sequence<Animation> getAnimations(optional GetAnimationsOptions options = {});
135};
136
137dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
138 DOMString id = "";
139 AnimationTimeline? timeline;
140};
141
142dictionary GetAnimationsOptions {
143 boolean subtree = false;
144};
145
146partial interface Document {
147 readonly attribute DocumentTimeline timeline;
148};
149
150partial interface mixin DocumentOrShadowRoot {
151 sequence<Animation> getAnimations();
152};
153
154Element includes Animatable;