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
|
2015-04-21 04:22:09 +03:00
|
|
|
* http://w3c.github.io/web-animations/#the-animation-interface
|
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.
|
|
|
|
*/
|
|
|
|
|
2014-10-20 08:55:45 +04:00
|
|
|
enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
|
|
|
|
|
2016-04-22 07:41:59 +03:00
|
|
|
[Func="nsDocument::IsElementAnimateEnabled",
|
2016-01-17 03:02:00 +03:00
|
|
|
Constructor (optional KeyframeEffectReadOnly? 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;
|
2015-04-15 02:48:21 +03:00
|
|
|
// Bug 1049975: Make 'effect' writeable
|
2016-04-18 03:16:04 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled", Pure]
|
2015-04-30 16:06:43 +03:00
|
|
|
readonly attribute AnimationEffectReadOnly? effect;
|
2016-04-18 03:16:04 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled"]
|
2015-04-28 10:25:07 +03:00
|
|
|
readonly 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;
|
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 ();
|
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;
|
|
|
|
};
|