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
|
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"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
|
|
|
|
IterationCompositeOperation iterationComposite = "replace";
|
|
|
|
CompositeOperation composite = "replace";
|
|
|
|
};
|
|
|
|
|
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.
|
2016-09-04 10:34:21 +03:00
|
|
|
[Func="nsDocument::IsWebAnimationsEnabled",
|
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
|
|
|
RunConstructorInCallerCompartment,
|
2016-10-28 10:41:08 +03:00
|
|
|
Constructor ((Element or CSSPseudoElement)? target,
|
|
|
|
object? keyframes,
|
|
|
|
optional (unrestricted double or KeyframeEffectOptions) options),
|
2018-05-07 05:08:59 +03:00
|
|
|
Constructor (KeyframeEffect source)]
|
|
|
|
interface KeyframeEffect : AnimationEffectReadOnly {
|
2018-05-07 04:48:48 +03:00
|
|
|
attribute (Element or CSSPseudoElement)? target;
|
|
|
|
[NeedsCallerType]
|
2018-05-07 05:08:59 +03:00
|
|
|
attribute IterationCompositeOperation iterationComposite;
|
|
|
|
attribute CompositeOperation composite;
|
|
|
|
[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
|
|
|
};
|