1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * The origin of this IDL file is
7 * https://drafts.csswg.org/web-animations/#animationeffectreadonly
8 *
9 * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
11 */
12
13enum FillMode {
14  "none",
15  "forwards",
16  "backwards",
17  "both",
18  "auto"
19};
20
21enum PlaybackDirection {
22  "normal",
23  "reverse",
24  "alternate",
25  "alternate-reverse"
26};
27
28dictionary EffectTiming {
29  double                              delay = 0.0;
30  double                              endDelay = 0.0;
31  FillMode                            fill = "auto";
32  double                              iterationStart = 0.0;
33  unrestricted double                 iterations = 1.0;
34  (unrestricted double or DOMString)  duration = "auto";
35  PlaybackDirection                   direction = "normal";
36  UTF8String                          easing = "linear";
37};
38
39dictionary OptionalEffectTiming {
40  double                              delay;
41  double                              endDelay;
42  FillMode                            fill;
43  double                              iterationStart;
44  unrestricted double                 iterations;
45  (unrestricted double or DOMString)  duration;
46  PlaybackDirection                   direction;
47  UTF8String                          easing;
48};
49
50dictionary ComputedEffectTiming : EffectTiming {
51  unrestricted double   endTime = 0.0;
52  unrestricted double   activeDuration = 0.0;
53  double?               localTime = null;
54  double?               progress = null;
55  unrestricted double?  currentIteration = null;
56};
57
58[Func="Document::IsWebAnimationsEnabled",
59 Exposed=Window]
60interface AnimationEffect {
61  EffectTiming getTiming();
62  [BinaryName="getComputedTimingAsDict"]
63  ComputedEffectTiming getComputedTiming();
64  [Throws]
65  void updateTiming(optional OptionalEffectTiming timing = {});
66};
67