Bug 1248340 - Part 2: Add the preference. draft
authorBoris Chiou <boris.chiou@gmail.com>
Sun, 26 Feb 2017 14:04:51 +0800
changeset 490042 3df091725e41092a93032052d175cc1ff301b58f
parent 490041 5a3bef68201f771dae6bb754f5d5d7531d0a5c00
child 490043 e5def18d1f40667b542a9dec1dde3aa4982cd84f
push id46982
push userbmo:boris.chiou@gmail.com
push dateMon, 27 Feb 2017 16:11:57 +0000
bugs1248340
milestone54.0a1
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
layout/style/nsCSSParser.cpp
modules/libpref/init/all.js
--- 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);