Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / webidl / Animation.webidl
blob06a07784d57bcdb0ec3b11fdd6ccadc643c3b35c
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/#animation
8  *
9  * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 enum AnimationPlayState { "idle", "running", "paused", "finished" };
15 enum AnimationReplaceState { "active", "removed", "persisted" };
17 [Exposed=Window]
18 interface Animation : EventTarget {
19   [Throws]
20   constructor(optional AnimationEffect? effect = null,
21               optional AnimationTimeline? timeline);
23   attribute DOMString id;
24   [Pure]
25   attribute AnimationEffect? effect;
26   // Bug 1676794. Drop BinaryName once we support ScrollTimeline interface.
27   [Func="Document::AreWebAnimationsTimelinesEnabled",
28    BinaryName="timelineFromJS"]
29   attribute AnimationTimeline? timeline;
31   [BinaryName="startTimeAsDouble"]
32   attribute double? startTime;
33   [SetterThrows, BinaryName="currentTimeAsDouble"]
34   attribute double? currentTime;
36            attribute double             playbackRate;
37   [BinaryName="playStateFromJS"]
38   readonly attribute AnimationPlayState playState;
39   [BinaryName="pendingFromJS"]
40   readonly attribute boolean            pending;
41   readonly attribute AnimationReplaceState replaceState;
42   [Throws]
43   readonly attribute Promise<Animation> ready;
44   [Throws]
45   readonly attribute Promise<Animation> finished;
46            attribute EventHandler       onfinish;
47            attribute EventHandler       oncancel;
48            attribute EventHandler       onremove;
49   undefined cancel();
50   [Throws]
51   undefined finish();
52   [Throws, BinaryName="playFromJS"]
53   undefined play();
54   [Throws, BinaryName="pauseFromJS"]
55   undefined pause();
56   undefined updatePlaybackRate (double playbackRate);
57   [Throws]
58   undefined reverse();
59   undefined persist();
60   [CEReactions, Throws]
61   undefined commitStyles();
64 // Non-standard extensions
65 partial interface Animation {
66   [ChromeOnly] readonly attribute boolean isRunningOnCompositor;