2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-04-15 02:48:21 +03:00
|
|
|
/* 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/#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"
|
|
|
|
};
|
|
|
|
|
2018-05-07 06:09:54 +03:00
|
|
|
dictionary KeyframeEffectOptions : EffectTiming {
|
2020-03-05 12:42:55 +03:00
|
|
|
[Pref="dom.animations-api.compositing.enabled"]
|
2015-11-12 05:40:00 +03:00
|
|
|
IterationCompositeOperation iterationComposite = "replace";
|
2020-03-05 12:42:55 +03:00
|
|
|
[Pref="dom.animations-api.compositing.enabled"]
|
2015-11-12 05:40:00 +03:00
|
|
|
CompositeOperation composite = "replace";
|
2020-02-18 23:44:14 +03:00
|
|
|
DOMString? pseudoElement = null;
|
2015-11-12 05:40:00 +03:00
|
|
|
};
|
|
|
|
|
2018-05-07 05:08:59 +03:00
|
|
|
// KeyframeEffect should run in the caller's compartment to do custom
|
Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:
1. GlobalObject::CallerType(), that is ultimately passed to
nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
to decide whether to copy mIterationComposite/mComposite to
KeyframeEffectParams.
GlobalObject::CallerType() can now be different than the target window's one,
if the caller has the system principal and the target is web content, and
in that case nsDocument::IsWebAnimationsEnabled there always returns true
while Web Animations can be disabled on web content.
honoring the mIterationComposite/mComposite properties is OK, since it just
changes the animation behavior, and this is disabled by default until
remaining spec issues are resolved.
2. GlobalObject::Context(), that is ultimately passed to
KeyframeUtils::GetKeyframesFromObject and used while extracting information
from passed-in keyframe object, with iterable/iterator protocols.
Performing that operation in the caller side is okay, since the same thing
can be done on caller, and the operation doesn't perform any GCThing
allocation on the target window global.
2018-02-17 11:21:13 +03:00
|
|
|
// processing on the `keyframes` object.
|
2019-01-02 16:05:23 +03:00
|
|
|
[Func="Document::IsWebAnimationsEnabled",
|
2019-09-27 18:26:14 +03:00
|
|
|
RunConstructorInCallerCompartment,
|
|
|
|
Exposed=Window]
|
2018-05-07 05:15:16 +03:00
|
|
|
interface KeyframeEffect : AnimationEffect {
|
2019-09-12 14:01:17 +03:00
|
|
|
[Throws]
|
2020-02-18 23:44:14 +03:00
|
|
|
constructor(Element? target,
|
2019-09-12 14:01:17 +03:00
|
|
|
object? keyframes,
|
|
|
|
optional (unrestricted double or KeyframeEffectOptions) options = {});
|
|
|
|
[Throws]
|
|
|
|
constructor(KeyframeEffect source);
|
|
|
|
|
2020-02-18 23:44:14 +03:00
|
|
|
attribute Element? target;
|
|
|
|
[SetterThrows] attribute DOMString? pseudoElement;
|
2018-07-14 03:23:03 +03:00
|
|
|
[Pref="dom.animations-api.compositing.enabled"]
|
2018-05-07 05:08:59 +03:00
|
|
|
attribute IterationCompositeOperation iterationComposite;
|
2018-07-14 03:23:03 +03:00
|
|
|
[Pref="dom.animations-api.compositing.enabled"]
|
2018-05-07 05:08:59 +03:00
|
|
|
attribute CompositeOperation composite;
|
2019-05-20 08:22:44 +03:00
|
|
|
[Throws] sequence<object> getKeyframes();
|
|
|
|
[Throws] void setKeyframes(object? keyframes);
|
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;
|
2016-12-04 02:07:39 +03:00
|
|
|
DOMString value;
|
2016-03-17 05:13:50 +03:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2018-05-07 05:08:59 +03:00
|
|
|
partial interface KeyframeEffect {
|
2016-03-17 07:47:14 +03:00
|
|
|
[ChromeOnly, Throws] sequence<AnimationPropertyDetails> getProperties();
|
2016-03-04 00:36:41 +03:00
|
|
|
};
|