2015-04-15 02:48:21 +03: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
|
2016-02-15 03:34:47 +03:00
|
|
|
* https://w3c.github.io/web-animations/#the-keyframeeffect-interfaces
|
2015-04-15 02:48:21 +03:00
|
|
|
*
|
|
|
|
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2015-11-12 05:40:00 +03:00
|
|
|
enum IterationCompositeOperation {
|
|
|
|
"replace",
|
|
|
|
"accumulate"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
|
|
|
|
IterationCompositeOperation iterationComposite = "replace";
|
|
|
|
CompositeOperation composite = "replace";
|
|
|
|
DOMString spacing = "distribute";
|
|
|
|
};
|
|
|
|
|
2016-02-05 21:01:00 +03:00
|
|
|
// Bug 1241783: For the constructor we use (Element or CSSPseudoElement)? for
|
|
|
|
// the first argument since we cannot convert a mixin into a union type
|
|
|
|
// automatically.
|
2015-04-15 02:48:21 +03:00
|
|
|
[HeaderFile="mozilla/dom/KeyframeEffect.h",
|
2015-10-22 11:22:38 +03:00
|
|
|
Func="nsDocument::IsWebAnimationsEnabled",
|
2016-02-05 21:01:00 +03:00
|
|
|
Constructor((Element or CSSPseudoElement)? target,
|
2016-05-13 03:40:52 +03:00
|
|
|
object? keyframes,
|
2015-11-12 05:40:00 +03:00
|
|
|
optional (unrestricted double or KeyframeEffectOptions) options)]
|
2015-04-30 16:06:43 +03:00
|
|
|
interface KeyframeEffectReadOnly : AnimationEffectReadOnly {
|
2016-02-05 21:01:00 +03:00
|
|
|
// Bug 1241783: As with the constructor, we use (Element or CSSPseudoElement)?
|
|
|
|
// for the type of |target| instead of Animatable?
|
|
|
|
readonly attribute (Element or CSSPseudoElement)? target;
|
2015-11-12 05:40:00 +03:00
|
|
|
readonly attribute IterationCompositeOperation iterationComposite;
|
|
|
|
readonly attribute CompositeOperation composite;
|
|
|
|
readonly attribute DOMString spacing;
|
|
|
|
|
2015-04-15 02:48:21 +03:00
|
|
|
// Not yet implemented:
|
|
|
|
// KeyframeEffect clone();
|
2015-09-29 05:20:14 +03:00
|
|
|
|
|
|
|
// We use object instead of ComputedKeyframe so that we can put the
|
|
|
|
// property-value pairs on the object.
|
2016-05-13 03:40:52 +03:00
|
|
|
[Throws] sequence<object> getKeyframes();
|
2015-04-15 02:48:21 +03:00
|
|
|
};
|
2016-02-15 03:34:47 +03:00
|
|
|
|
2016-03-04 00:36:41 +03:00
|
|
|
// Non-standard extensions
|
2016-03-13 14:20:37 +03:00
|
|
|
dictionary AnimationPropertyValueDetails {
|
2016-03-17 05:13:50 +03:00
|
|
|
required double offset;
|
|
|
|
required DOMString value;
|
|
|
|
DOMString easing;
|
|
|
|
required CompositeOperation composite;
|
2016-03-13 14:20:37 +03:00
|
|
|
};
|
|
|
|
|
2016-03-13 14:10:10 +03:00
|
|
|
dictionary AnimationPropertyDetails {
|
2016-03-17 05:13:50 +03:00
|
|
|
required DOMString property;
|
|
|
|
required boolean runningOnCompositor;
|
|
|
|
DOMString warning;
|
|
|
|
required sequence<AnimationPropertyValueDetails> values;
|
2016-03-04 00:36:41 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
partial interface KeyframeEffectReadOnly {
|
2016-03-17 07:47:14 +03:00
|
|
|
[ChromeOnly, Throws] sequence<AnimationPropertyDetails> getProperties();
|
2016-03-04 00:36:41 +03:00
|
|
|
};
|
2016-02-15 03:34:47 +03:00
|
|
|
|
2016-02-18 15:36:00 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled",
|
|
|
|
Constructor ((Element or CSSPseudoElement)? target,
|
2016-05-13 03:40:52 +03:00
|
|
|
object? keyframes,
|
2016-02-15 03:34:47 +03:00
|
|
|
optional (unrestricted double or KeyframeEffectOptions) options)]
|
2016-02-15 03:34:47 +03:00
|
|
|
interface KeyframeEffect : KeyframeEffectReadOnly {
|
2016-04-28 18:22:43 +03:00
|
|
|
inherit attribute (Element or CSSPseudoElement)? target;
|
2016-02-15 03:34:47 +03:00
|
|
|
// Bug 1216843 - implement animation composition
|
|
|
|
// inherit attribute IterationCompositeOperation iterationComposite;
|
|
|
|
// Bug 1216844 - implement additive animation
|
|
|
|
// inherit attribute CompositeOperation composite;
|
|
|
|
// Bug 1244590 - implement spacing modes
|
|
|
|
// inherit attribute DOMString spacing;
|
2016-04-09 09:33:34 +03:00
|
|
|
[Throws]
|
2016-05-13 03:40:52 +03:00
|
|
|
void setKeyframes (object? keyframes);
|
2016-02-15 03:34:47 +03:00
|
|
|
};
|