// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/animation-worklet/#worklet-animation-desc
// TODO(840383): Accodring to the specification |effects| is optional and
// defaults to null. Match that here.
[
Exposed=Window,
RuntimeEnabled=AnimationWorklet
] interface WorkletAnimation {
[CallWith=ScriptState, RaisesException, MeasureAs=WorkletAnimationConstructor]
constructor(DOMString animatorName,
(AnimationEffect or sequence<AnimationEffect>) effects,
optional (DocumentTimeline or ScrollTimeline) timeline,
optional any options);
readonly attribute DOMString animatorName;
readonly attribute AnimationEffect? effect;
readonly attribute AnimationTimeline? timeline;
readonly attribute AnimationPlayState playState;
readonly attribute double? currentTime;
readonly attribute double? startTime;
[CallWith=ScriptState] attribute double playbackRate;
[RaisesException] void play();
[RaisesException] void pause();
void cancel();
};