2014-07-16 04:02:31 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2017-12-15 23:55:55 +03:00
|
|
|
* https://drafts.csswg.org/web-animations/#animation
|
2014-07-16 04:02:31 +04:00
|
|
|
*
|
2015-04-21 04:22:09 +03:00
|
|
|
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
2014-07-16 04:02:31 +04:00
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2018-03-16 06:49:55 +03:00
|
|
|
enum AnimationPlayState { "idle", "running", "paused", "finished" };
|
2014-10-20 08:55:45 +04:00
|
|
|
|
2016-04-22 07:41:59 +03:00
|
|
|
[Func="nsDocument::IsElementAnimateEnabled",
|
2018-05-07 05:15:16 +03:00
|
|
|
Constructor (optional AnimationEffect? effect = null,
|
2016-05-30 03:01:11 +03:00
|
|
|
optional AnimationTimeline? timeline)]
|
2015-07-31 00:23:00 +03:00
|
|
|
interface Animation : EventTarget {
|
2016-01-08 11:17:00 +03:00
|
|
|
attribute DOMString id;
|
2016-04-18 03:16:04 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled", Pure]
|
2018-05-07 05:15:16 +03:00
|
|
|
attribute AnimationEffect? effect;
|
2016-04-18 03:16:04 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled"]
|
2016-05-31 03:42:38 +03:00
|
|
|
attribute AnimationTimeline? timeline;
|
2014-12-04 19:28:38 +03:00
|
|
|
[BinaryName="startTimeAsDouble"]
|
2015-02-09 13:26:27 +03:00
|
|
|
attribute double? startTime;
|
2015-03-09 19:50:39 +03:00
|
|
|
[SetterThrows, BinaryName="currentTimeAsDouble"]
|
|
|
|
attribute double? currentTime;
|
2014-08-30 10:11:56 +04:00
|
|
|
|
2015-03-13 23:10:45 +03:00
|
|
|
attribute double playbackRate;
|
2014-10-20 08:55:45 +04:00
|
|
|
[BinaryName="playStateFromJS"]
|
2014-08-30 10:11:56 +04:00
|
|
|
readonly attribute AnimationPlayState playState;
|
2018-03-16 06:49:55 +03:00
|
|
|
[BinaryName="pendingFromJS"]
|
2017-11-21 11:10:59 +03:00
|
|
|
readonly attribute boolean pending;
|
2016-04-22 07:41:58 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled", Throws]
|
2015-04-21 04:22:09 +03:00
|
|
|
readonly attribute Promise<Animation> ready;
|
2016-04-18 03:16:04 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled", Throws]
|
2015-04-21 04:22:09 +03:00
|
|
|
readonly attribute Promise<Animation> finished;
|
2015-07-31 00:25:00 +03:00
|
|
|
attribute EventHandler onfinish;
|
2015-07-31 00:26:00 +03:00
|
|
|
attribute EventHandler oncancel;
|
2014-08-30 10:11:56 +04:00
|
|
|
void cancel ();
|
2015-04-16 19:15:20 +03:00
|
|
|
[Throws]
|
|
|
|
void finish ();
|
2015-05-19 08:00:48 +03:00
|
|
|
[Throws, BinaryName="playFromJS"]
|
2014-08-30 10:11:56 +04:00
|
|
|
void play ();
|
2015-05-19 08:55:26 +03:00
|
|
|
[Throws, BinaryName="pauseFromJS"]
|
2014-08-30 10:11:56 +04:00
|
|
|
void pause ();
|
2018-02-13 09:04:18 +03:00
|
|
|
void updatePlaybackRate (double playbackRate);
|
2015-07-09 23:54:00 +03:00
|
|
|
[Throws]
|
2014-08-30 10:11:56 +04:00
|
|
|
void reverse ();
|
2014-07-16 04:02:31 +04:00
|
|
|
};
|
2014-08-22 16:42:47 +04:00
|
|
|
|
|
|
|
// Non-standard extensions
|
2015-04-21 04:22:09 +03:00
|
|
|
partial interface Animation {
|
2014-08-22 16:42:47 +04:00
|
|
|
[ChromeOnly] readonly attribute boolean isRunningOnCompositor;
|
|
|
|
};
|