Bug 1619276 - Fix the order of the setting of Keyframe options. r=smaug,birtles

Besides, we add the pref setup in the webidl, so if we turn it off,
iterationComposite and composite will always be the default values.

Differential Revision: https://phabricator.services.mozilla.com/D65437

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Chiou 2020-03-05 09:42:55 +00:00
parent 4fc8a0de16
commit 73f98d78b8
2 changed files with 7 additions and 4 deletions

View File

@ -724,15 +724,16 @@ template <class OptionsType>
static KeyframeEffectParams KeyframeEffectParamsFromUnion(
const OptionsType& aOptions, CallerType aCallerType, ErrorResult& aRv) {
KeyframeEffectParams result;
if (aOptions.IsUnrestrictedDouble() ||
// Ignore iterationComposite and composite if the corresponding pref is
// not set. The default value 'Replace' will be used instead.
!StaticPrefs::dom_animations_api_compositing_enabled()) {
if (aOptions.IsUnrestrictedDouble()) {
return result;
}
const KeyframeEffectOptions& options =
KeyframeEffectOptionsFromUnion(aOptions);
// If dom.animations-api.compositing.enabled is turned off,
// iterationComposite and composite are the default value 'replace' in the
// dictionary.
result.mIterationComposite = options.mIterationComposite;
result.mComposite = options.mComposite;

View File

@ -16,7 +16,9 @@ enum IterationCompositeOperation {
};
dictionary KeyframeEffectOptions : EffectTiming {
[Pref="dom.animations-api.compositing.enabled"]
IterationCompositeOperation iterationComposite = "replace";
[Pref="dom.animations-api.compositing.enabled"]
CompositeOperation composite = "replace";
DOMString? pseudoElement = null;
};