diff --git a/dom/animation/AnimationUtils.cpp b/dom/animation/AnimationUtils.cpp index 0add3c3a6b8b..476652f77876 100644 --- a/dom/animation/AnimationUtils.cpp +++ b/dom/animation/AnimationUtils.cpp @@ -6,6 +6,7 @@ #include "AnimationUtils.h" +#include "nsContentUtils.h" // For nsContentUtils::IsCallerChrome #include "nsDebug.h" #include "nsIAtom.h" #include "nsIContent.h" @@ -63,7 +64,7 @@ AnimationUtils::IsOffscreenThrottlingEnabled() } /* static */ bool -AnimationUtils::IsCoreAPIEnabled() +AnimationUtils::IsCoreAPIEnabledForCaller() { static bool sCoreAPIEnabled; static bool sPrefCached = false; @@ -74,7 +75,7 @@ AnimationUtils::IsCoreAPIEnabled() "dom.animations-api.core.enabled"); } - return sCoreAPIEnabled; + return sCoreAPIEnabled || nsContentUtils::IsCallerChrome(); } } // namespace mozilla diff --git a/dom/animation/AnimationUtils.h b/dom/animation/AnimationUtils.h index 94d346abc135..82ae69bc85af 100644 --- a/dom/animation/AnimationUtils.h +++ b/dom/animation/AnimationUtils.h @@ -63,10 +63,10 @@ public: /** * Returns true if the preference to enable the core Web Animations API is - * true. + * true or the caller is chrome. */ static bool - IsCoreAPIEnabled(); + IsCoreAPIEnabledForCaller(); }; } // namespace mozilla diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index c48867cb1361..00f63bc000a0 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -132,7 +132,7 @@ KeyframeEffect::SetIterationComposite( { // Ignore iterationComposite if the Web Animations API is not enabled, // then the default value 'Replace' will be used. - if (!AnimationUtils::IsCoreAPIEnabled()) { + if (!AnimationUtils::IsCoreAPIEnabledForCaller()) { return; } diff --git a/dom/animation/KeyframeEffectParams.cpp b/dom/animation/KeyframeEffectParams.cpp index 4490faed105a..25764069194c 100644 --- a/dom/animation/KeyframeEffectParams.cpp +++ b/dom/animation/KeyframeEffectParams.cpp @@ -115,7 +115,7 @@ KeyframeEffectParams::ParseSpacing(const nsAString& aSpacing, // Ignore spacing if the core API is not enabled since it is not yet ready to // ship. - if (!AnimationUtils::IsCoreAPIEnabled()) { + if (!AnimationUtils::IsCoreAPIEnabledForCaller()) { aSpacingMode = SpacingMode::distribute; return; } diff --git a/dom/animation/KeyframeEffectReadOnly.cpp b/dom/animation/KeyframeEffectReadOnly.cpp index cb8e668796a3..58349a669473 100644 --- a/dom/animation/KeyframeEffectReadOnly.cpp +++ b/dom/animation/KeyframeEffectReadOnly.cpp @@ -512,7 +512,7 @@ KeyframeEffectParamsFromUnion(const OptionsType& aOptions, aRv); // Ignore iterationComposite if the Web Animations API is not enabled, // then the default value 'Replace' will be used. - if (AnimationUtils::IsCoreAPIEnabled()) { + if (AnimationUtils::IsCoreAPIEnabledForCaller()) { result.mIterationComposite = options.mIterationComposite; } }