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