2014-07-16 00:02:31 +00: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 01:22:09 +00:00
|
|
|
* http://w3c.github.io/web-animations/#the-animation-interface
|
2014-07-16 00:02:31 +00:00
|
|
|
*
|
2015-04-21 01:22:09 +00:00
|
|
|
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
2014-07-16 00:02:31 +00:00
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2014-10-20 04:55:45 +00:00
|
|
|
enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
|
|
|
|
|
2015-01-08 04:53:24 +00:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled"]
|
2015-07-30 21:23:00 +00:00
|
|
|
interface Animation : EventTarget {
|
2015-04-14 23:48:21 +00:00
|
|
|
// Bug 1049975: Make 'effect' writeable
|
2014-08-30 06:11:56 +00:00
|
|
|
[Pure]
|
2015-04-30 13:06:43 +00:00
|
|
|
readonly attribute AnimationEffectReadOnly? effect;
|
2015-04-28 07:25:07 +00:00
|
|
|
readonly attribute AnimationTimeline? timeline;
|
2014-12-04 16:28:38 +00:00
|
|
|
[BinaryName="startTimeAsDouble"]
|
2015-02-09 10:26:27 +00:00
|
|
|
attribute double? startTime;
|
2015-03-09 16:50:39 +00:00
|
|
|
[SetterThrows, BinaryName="currentTimeAsDouble"]
|
|
|
|
attribute double? currentTime;
|
2014-08-30 06:11:56 +00:00
|
|
|
|
2015-03-13 20:10:45 +00:00
|
|
|
attribute double playbackRate;
|
2014-10-20 04:55:45 +00:00
|
|
|
[BinaryName="playStateFromJS"]
|
2014-08-30 06:11:56 +00:00
|
|
|
readonly attribute AnimationPlayState playState;
|
2014-12-17 23:42:40 +00:00
|
|
|
[Throws]
|
2015-04-21 01:22:09 +00:00
|
|
|
readonly attribute Promise<Animation> ready;
|
2015-03-18 13:22:11 +00:00
|
|
|
[Throws]
|
2015-04-21 01:22:09 +00:00
|
|
|
readonly attribute Promise<Animation> finished;
|
2015-07-30 21:25:00 +00:00
|
|
|
attribute EventHandler onfinish;
|
2015-07-30 21:26:00 +00:00
|
|
|
attribute EventHandler oncancel;
|
2014-08-30 06:11:56 +00:00
|
|
|
void cancel ();
|
2015-04-16 16:15:20 +00:00
|
|
|
[Throws]
|
|
|
|
void finish ();
|
2015-05-19 05:00:48 +00:00
|
|
|
[Throws, BinaryName="playFromJS"]
|
2014-08-30 06:11:56 +00:00
|
|
|
void play ();
|
2015-05-19 05:55:26 +00:00
|
|
|
[Throws, BinaryName="pauseFromJS"]
|
2014-08-30 06:11:56 +00:00
|
|
|
void pause ();
|
2015-07-09 20:54:00 +00:00
|
|
|
[Throws]
|
2014-08-30 06:11:56 +00:00
|
|
|
void reverse ();
|
2014-07-16 00:02:31 +00:00
|
|
|
};
|
2014-08-22 12:42:47 +00:00
|
|
|
|
|
|
|
// Non-standard extensions
|
2015-04-21 01:22:09 +00:00
|
|
|
partial interface Animation {
|
2014-08-22 12:42:47 +00:00
|
|
|
[ChromeOnly] readonly attribute boolean isRunningOnCompositor;
|
|
|
|
};
|