Files
sousa-gecko/dom/webidl/AnimationEffect.webidl
T
Jonathan Watt bbef6d6fa7 Bug 2017466. Use CSSNumberish and CSSNumericValue for ComputedEffectTiming. r=boris,webidl,smaug
Per Web Animations Level 2, three ComputedEffectTiming fields change:
  - CSSNumberish is added to endTime, activeDuration
  - CSSNumberish? is added to localTime

And CSSNumericValue is added to EffectTiming.duration and to
OptionalEffectTiming.duration.

GetComputedTimingAsDict picks between a plain double (ms) and a
percent CSSUnitValue depending on whether the animation's timeline is
a progress-based timeline or not.

Differential Revision: https://phabricator.services.mozilla.com/D302248
2026-06-02 03:05:22 +00:00

69 lines
2.5 KiB
Plaintext

/* 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
* https://drafts.csswg.org/web-animations/#animationeffectreadonly
*
* Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
enum FillMode {
"none",
"forwards",
"backwards",
"both",
"auto"
};
enum PlaybackDirection {
"normal",
"reverse",
"alternate",
"alternate-reverse"
};
dictionary EffectTiming {
// TODO: delay and endDelay should no longer have default values:
// https://drafts.csswg.org/web-animations-2/#the-effecttiming-dictionaries
double delay = 0.0;
double endDelay = 0.0;
FillMode fill = "auto";
double iterationStart = 0.0;
unrestricted double iterations = 1.0;
(unrestricted double or CSSNumericValue or DOMString) duration = "auto";
PlaybackDirection direction = "normal";
UTF8String easing = "linear";
};
dictionary OptionalEffectTiming {
double delay;
double endDelay;
FillMode fill;
double iterationStart;
unrestricted double iterations;
// CSSNumericValue isn't currently in the spec, but that's probably a bug:
// https://github.com/w3c/csswg-drafts/issues/13990
(unrestricted double or CSSNumericValue or DOMString) duration;
PlaybackDirection direction;
UTF8String easing;
};
dictionary ComputedEffectTiming : EffectTiming {
CSSNumberish endTime;
CSSNumberish activeDuration;
CSSNumberish? localTime;
double? progress = null;
unrestricted double? currentIteration = null;
};
[Exposed=Window]
interface AnimationEffect {
EffectTiming getTiming();
[BinaryName="getComputedTimingAsDict"]
ComputedEffectTiming getComputedTiming();
[Throws]
undefined updateTiming(optional OptionalEffectTiming timing = {});
};