1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * The origin of this IDL file is
7 * https://drafts.csswg.org/web-animations/#the-compositeoperation-enumeration
8 * https://drafts.csswg.org/web-animations/#dictdef-basepropertyindexedkeyframe
9 * https://drafts.csswg.org/web-animations/#dictdef-basekeyframe
10 * https://drafts.csswg.org/web-animations/#dictdef-basecomputedkeyframe
11 *
12 * Copyright © 2016 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
13 * liability, trademark and document use rules apply.
14 */
15
16enum CompositeOperation { "replace", "add", "accumulate" };
17
18// NOTE: The order of the values in this enum are important.
19//
20// We assume that CompositeOperation is a subset of CompositeOperationOrAuto so
21// that we can cast between the two types (provided the value is not "auto").
22//
23// If that assumption ceases to hold we will need to update the conversion
24// in KeyframeUtils::GetAnimationPropertiesFromKeyframes.
25enum CompositeOperationOrAuto { "replace", "add", "accumulate", "auto" };
26
27// The following dictionary types are not referred to by other .webidl files,
28// but we use it for manual JS->IDL and IDL->JS conversions in KeyframeEffect's
29// implementation.
30
31[GenerateInit]
32dictionary BasePropertyIndexedKeyframe {
33  (double? or sequence<double?>) offset = [];
34  (UTF8String or sequence<UTF8String>) easing = [];
35  (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = [];
36};
37
38[GenerateInit]
39dictionary BaseKeyframe {
40  double? offset = null;
41  UTF8String easing = "linear";
42  [Pref="dom.animations-api.compositing.enabled"]
43  CompositeOperationOrAuto composite = "auto";
44
45  // Non-standard extensions
46
47  // Member to allow testing when StyleAnimationValue::ComputeValues fails.
48  //
49  // Note that we currently only apply this to shorthand properties since
50  // it's easier to annotate shorthand property values and because we have
51  // only ever observed ComputeValues failing on shorthand values.
52  //
53  // Bug 1216844 should remove this member since after that bug is fixed we will
54  // have a well-defined behavior to use when animation endpoints are not
55  // available.
56  [ChromeOnly] boolean simulateComputeValuesFailure = false;
57};
58
59[GenerateConversionToJS]
60dictionary BaseComputedKeyframe : BaseKeyframe {
61  double computedOffset;
62};
63