mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1304805 - Make spacing, iteration composite and effect composite work if the caller is chrome. r=hiro
MozReview-Commit-ID: 30BOUA8QPh8 --HG-- extra : rebase_source : 21af58ad6f27f47404affe2f87fb9a426f01b496
This commit is contained in:
parent
bd2546e3ae
commit
cd6c2e6bff
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user