[csswg-drafts] Pull Request: [web-animations-1] Replace *ReadOnly interfaces and timing objects

birtles has just labeled a pull request from birtles for https://github.com/w3c/csswg-drafts as "web-animations-1":

== [web-animations-1] Replace *ReadOnly interfaces and timing objects ==
This fixes #2065 and #2068. It also fixes #2055.

Summary of changes:
* Replaced `AnimationEffectReadOnly` with `AnimationEffect`.
* Replaced the timing member of `AnimationEffectReadOnly` with the `getTiming()` and `updateTiming()` methods on `AnimationEffect`.
* Removed the `AnimationEffectTimingReadOnly` and `AnimationEffectTiming` interfaces.
* Renamed the `AnimationEffectTimingProperties` dictionary to `EffectTiming`.
* Renamed the `ComputedTimingProperties` dictionary to `ComputedEffectTiming`.
* Introduced the `OptionalEffectTiming` dictionary for use with the `updateTiming()` method.
* Removed `KeyframeEffectReadOnly`, leaving only `KeyframeEffect`.

The relevant parts of the new IDL look something like:

```webidl
[Exposed=Window]
interface AnimationEffect {
    EffectTiming         getTiming();
    ComputedEffectTiming getComputedTiming();
    void                 updateTiming(optional OptionalEffectTiming timing);
};

dictionary EffectTiming {
    double                             delay = 0;
    double                             endDelay = 0;
    FillMode                           fill = "auto";
    double                             iterationStart = 0.0;
    unrestricted double                iterations = 1.0;
    (unrestricted double or DOMString) duration = "auto";
    PlaybackDirection                  direction = "normal";
    DOMString                          easing = "linear";
};

dictionary OptionalEffectTiming {
    double                             delay;
    double                             endDelay;
    FillMode                           fill;
    double                             iterationStart;
    unrestricted double                iterations;
    (unrestricted double or DOMString) duration;
    PlaybackDirection                  direction;
    DOMString                          easing;
};

dictionary ComputedEffectTiming : EffectTiming {
    unrestricted double  endTime;
    unrestricted double  activeDuration;
    double?              localTime;
    double?              progress;
    unrestricted double? currentIteration;
};

[Exposed=Window,
 Constructor ((Element or CSSPseudoElement)? target,
              object? keyframes,
              optional (unrestricted double or KeyframeEffectOptions) options),
 Constructor (KeyframeEffect source)]
interface KeyframeEffect : AnimationEffect {
    attribute (Element or CSSPseudoElement)? target;
    attribute IterationCompositeOperation    iterationComposite;
    attribute CompositeOperation             composite;
    sequence<object> getKeyframes ();
    void             setKeyframes (object? keyframes);
};
```

See https://github.com/w3c/csswg-drafts/pull/2432

Received on Thursday, 15 March 2018 07:12:33 UTC