Bug 1248340 - Part 2: Add the preference.
The pref name: layout.css.timing.frames.enabled. We disable it on beta or
release build.
MozReview-Commit-ID: 3M3HtsYvbnw
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -16806,16 +16806,20 @@ CSSParserImpl::ParseTransitionStepTiming
bool
CSSParserImpl::ParseTransitionFramesTimingFunctionValues(nsCSSValue& aValue)
{
NS_ASSERTION(!mHavePushBack &&
mToken.mType == eCSSToken_Function &&
mToken.mIdent.LowerCaseEqualsLiteral("frames"),
"unexpected initial state");
+ if(!Preferences::GetBool("layout.css.timing.frames.enabled")) {
+ return false;
+ }
+
nsCSSKeyword functionName = nsCSSKeywords::LookupKeyword(mToken.mIdent);
MOZ_ASSERT(functionName == eCSSKeyword_frames);
RefPtr<nsCSSValue::Array> val = aValue.InitFunction(functionName, 1);
if (!ParseSingleTokenOneOrLargerVariant(val->Item(1), VARIANT_INTEGER,
nullptr)) {
return false;
}
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2742,16 +2742,23 @@ pref("layout.float-fragments-inside-colu
// The number of frames times the frame rate is the time required to
// pass without painting used to guess that we'll not paint again soon
pref("layout.idle_period.required_quiescent_frames", 2);
// The amount of time (milliseconds) needed between an idle period's
// end and the start of the next tick to avoid jank.
pref("layout.idle_period.time_limit", 1);
+// Pref to enable frames timing function.
+#ifdef RELEASE_OR_BETA
+pref("layout.css.timing.frames.enabled", false);
+#else
+pref("layout.css.timing.frames.enabled", true);
+#endif
+
// Is support for the Web Animations API enabled?
// Before enabling this by default, make sure also CSSPseudoElement interface
// has been spec'ed properly, or we should add a separate pref for
// CSSPseudoElement interface. See Bug 1174575 for further details.
#ifdef RELEASE_OR_BETA
pref("dom.animations-api.core.enabled", false);
#else
pref("dom.animations-api.core.enabled", true);