Animation.webidl (2251B)
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 */ 12 13 enum AnimationPlayState { "idle", "running", "paused", "finished" }; 14 15 enum AnimationReplaceState { "active", "removed", "persisted" }; 16 17 [Exposed=Window] 18 interface Animation : EventTarget { 19 [Throws] 20 constructor(optional AnimationEffect? effect = null, 21 optional AnimationTimeline? timeline); 22 23 attribute DOMString id; 24 [Pure] 25 attribute AnimationEffect? effect; 26 // Bug 1676794. Drop BinaryName once we support ScrollTimeline interface. 27 [BinaryName="timelineFromJS"] 28 attribute AnimationTimeline? timeline; 29 30 [BinaryName="startTimeAsDouble"] 31 attribute double? startTime; 32 [SetterThrows, BinaryName="currentTimeAsDouble"] 33 attribute double? currentTime; 34 35 readonly attribute double? overallProgress; 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(); 62 }; 63 64 // Non-standard extensions 65 partial interface Animation { 66 [ChromeOnly] readonly attribute boolean isRunningOnCompositor; 67 };