BaseKeyframeTypes.webidl (2479B)
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 16 enum 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. 25 enum 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] 32 dictionary BasePropertyIndexedKeyframe { 33 (double? or sequence<double?>) offset = []; 34 (UTF8String or sequence<UTF8String>) easing = []; 35 (CompositeOperationOrAuto or sequence<CompositeOperationOrAuto>) composite = []; 36 }; 37 38 [GenerateInit] 39 dictionary BaseKeyframe { 40 double? offset = null; 41 UTF8String easing = "linear"; 42 CompositeOperationOrAuto composite = "auto"; 43 44 // Non-standard extensions 45 46 // Member to allow testing when StyleAnimationValue::ComputeValues fails. 47 // 48 // Note that we currently only apply this to shorthand properties since 49 // it's easier to annotate shorthand property values and because we have 50 // only ever observed ComputeValues failing on shorthand values. 51 // 52 // Bug 1216844 should remove this member since after that bug is fixed we will 53 // have a well-defined behavior to use when animation endpoints are not 54 // available. 55 [ChromeOnly] boolean simulateComputeValuesFailure = false; 56 }; 57 58 [GenerateConversionToJS] 59 dictionary BaseComputedKeyframe : BaseKeyframe { 60 double computedOffset; 61 };