Bug 1471814 - Add dom.animations-api.timelines.enabled pref; r?hiro, r?bz
authorBrian Birtles <birtles@gmail.com>
Thu, 28 Jun 2018 16:24:57 +0900
changeset 1550873 622d272d704d6d6f834d44739bbfe7bda25f1fe3
parent 1550514 f8acdf0185d786809bfbe8cabab081400dc47c68
child 1550874 e9b44fdb4bc82e525d12aed51dc06666535b30a8
push id281189
push userbbirtles@mozilla.com
push dateThu, 28 Jun 2018 07:25:55 +0000
treeherdertry@e9b44fdb4bc8 [default view] [failures only]
reviewershiro, bz
bugs1471814
milestone63.0a1
Bug 1471814 - Add dom.animations-api.timelines.enabled pref; r?hiro, r?bz
browser/components/extensions/test/browser/browser-common.ini
browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
devtools/client/inspector/animation-old/test/head.js
devtools/client/inspector/animation/test/head.js
dom/animation/test/chrome/test_animation_observers_sync.html
dom/animation/test/crashtests/crashtests.list
dom/animation/test/mochitest.ini
dom/animation/test/mozilla/test_deferred_start.html
dom/animation/test/testcommon.js
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/webidl/Animation.webidl
dom/webidl/AnimationTimeline.webidl
dom/webidl/DocumentTimeline.webidl
dom/xslt/tests/mochitest/test_bug1135764.html
layout/base/crashtests/crashtests.list
layout/style/test/mochitest.ini
modules/libpref/init/all.js
testing/web-platform/meta/css/css-animations/__dir__.ini
testing/web-platform/meta/css/css-transitions/__dir__.ini
testing/web-platform/meta/web-animations/__dir__.ini
testing/web-platform/tests/css/css-animations/support/testcommon.js
--- a/browser/components/extensions/test/browser/browser-common.ini
+++ b/browser/components/extensions/test/browser/browser-common.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 prefs =
     dom.animations-api.core.enabled=true
+    dom.animations-api.timelines.enabled=true
 support-files =
   head.js
   head_pageAction.js
   head_sessions.js
   head_webNavigation.js
   context.html
   context_frame.html
   ctxmenu-image.png
--- a/browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
+++ b/browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
@@ -34,16 +34,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     resistFingerprinting = rfp;
     reduceTimerPrecision = rtp;
     prefName = "";
     prefName += resistFingerprinting ? "privacy.resistFingerprinting " : "";
     prefName += reduceTimerPrecision ? "privacy.reduceTimerPrecision " : "";
     SpecialPowers.pushPrefEnv({"set":
       [
         ["dom.animations-api.core.enabled", true],
+        ["dom.animations-api.timelines.enabled", true],
         ["privacy.resistFingerprinting", resistFingerprinting],
         ["privacy.reduceTimerPrecision", reduceTimerPrecision],
         ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
       ]
     }, runTest);
 
   }
 
--- a/devtools/client/inspector/animation-old/test/head.js
+++ b/devtools/client/inspector/animation-old/test/head.js
@@ -38,16 +38,17 @@ registerCleanupFunction(() => {
 // Some animation features are not enabled by default in release/beta channels
 // yet including:
 // * parts of the Web Animations API (Bug 1264101), and
 // * the frames() timing function (Bug 1379582).
 function enableAnimationFeatures() {
   return new Promise(resolve => {
     SpecialPowers.pushPrefEnv({"set": [
       ["dom.animations-api.core.enabled", true],
+      ["dom.animations-api.timelines.enabled", true],
       ["layout.css.frames-timing.enabled", true],
     ]}, resolve);
   });
 }
 
 /**
  * Add a new test tab in the browser and load the given url.
  * @param {String} url The url to be loaded in the new tab
--- a/devtools/client/inspector/animation/test/head.js
+++ b/devtools/client/inspector/animation/test/head.js
@@ -56,16 +56,17 @@ const closeAnimationInspector = async fu
  * yet including:
  *   * parts of the Web Animations API (Bug 1264101), and
  *   * the frames() timing function (Bug 1379582).
  */
 const enableAnimationFeatures = function() {
   return new Promise(resolve => {
     SpecialPowers.pushPrefEnv({"set": [
       ["dom.animations-api.core.enabled", true],
+      ["dom.animations-api.timelines.enabled", true],
       ["layout.css.frames-timing.enabled", true],
     ]}, resolve);
   });
 };
 
 /**
  * Add a new test tab in the browser and load the given url.
  *
--- a/dom/animation/test/chrome/test_animation_observers_sync.html
+++ b/dom/animation/test/chrome/test_animation_observers_sync.html
@@ -1579,16 +1579,21 @@ function runTest() {
     assert_equals_records(observer.takeRecords(),
       [{ added: [], changed: [], removed: [anim] }],
       "records after animation is finished");
   }, "exclude_animations_targeting_pseudo_elements");
 }
 
 setup({explicit_done: true});
 SpecialPowers.pushPrefEnv(
-  { set: [["dom.animations-api.core.enabled", true]] },
+  {
+    set: [
+      ["dom.animations-api.core.enabled", true],
+      ["dom.animations-api.timelines.enabled", true],
+    ],
+  },
   function() {
     runTest();
     done();
   }
 );
 
 </script>
--- a/dom/animation/test/crashtests/crashtests.list
+++ b/dom/animation/test/crashtests/crashtests.list
@@ -1,43 +1,43 @@
 pref(dom.animations-api.core.enabled,true) load 1239889-1.html
 pref(dom.animations-api.core.enabled,true) load 1244595-1.html
-pref(dom.animations-api.core.enabled,true) load 1216842-1.html
-pref(dom.animations-api.core.enabled,true) load 1216842-2.html
-pref(dom.animations-api.core.enabled,true) load 1216842-3.html
-pref(dom.animations-api.core.enabled,true) load 1216842-4.html
-pref(dom.animations-api.core.enabled,true) load 1216842-5.html
-pref(dom.animations-api.core.enabled,true) load 1216842-6.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-1.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-2.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-3.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-4.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-5.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-6.html
 pref(dom.animations-api.core.enabled,true) load 1272475-1.html
 pref(dom.animations-api.core.enabled,true) load 1272475-2.html
 pref(dom.animations-api.core.enabled,true) load 1278485-1.html
-pref(dom.animations-api.core.enabled,true) load 1277272-1.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1277272-1.html
 pref(dom.animations-api.core.enabled,true) load 1282691-1.html
 pref(dom.animations-api.core.enabled,true) load 1291413-1.html
 pref(dom.animations-api.core.enabled,true) load 1291413-2.html
 pref(dom.animations-api.core.enabled,true) load 1304886-1.html
 pref(dom.animations-api.core.enabled,true) load 1309198-1.html
 pref(dom.animations-api.core.enabled,true) load 1322382-1.html
 pref(dom.animations-api.core.enabled,true) load 1322291-1.html
 pref(dom.animations-api.core.enabled,true) load 1322291-2.html
 pref(dom.animations-api.core.enabled,true) load 1323114-1.html
 pref(dom.animations-api.core.enabled,true) load 1323114-2.html
 pref(dom.animations-api.core.enabled,true) load 1323119-1.html
 pref(dom.animations-api.core.enabled,true) load 1324554-1.html
 pref(dom.animations-api.core.enabled,true) load 1325193-1.html
 pref(dom.animations-api.core.enabled,true) load 1330190-1.html
 pref(dom.animations-api.core.enabled,true) load 1330190-2.html
 pref(dom.animations-api.core.enabled,true) load 1330513-1.html
-pref(dom.animations-api.core.enabled,true) load 1333539-1.html
-pref(dom.animations-api.core.enabled,true) load 1333539-2.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1333539-1.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1333539-2.html
 pref(dom.animations-api.core.enabled,true) load 1334582-1.html
 pref(dom.animations-api.core.enabled,true) load 1334582-2.html
 pref(dom.animations-api.core.enabled,true) load 1334583-1.html
 pref(dom.animations-api.core.enabled,true) load 1335998-1.html
 pref(dom.animations-api.core.enabled,true) load 1343589-1.html
 pref(dom.animations-api.core.enabled,true) load 1359658-1.html
 pref(dom.animations-api.core.enabled,true) load 1373712-1.html
 pref(dom.animations-api.core.enabled,true) load 1379606-1.html
 pref(dom.animations-api.core.enabled,true) load 1393605-1.html
 load 1400022-1.html
 pref(dom.animations-api.core.enabled,true) load 1401809.html
-pref(dom.animations-api.core.enabled,true) load 1411318-1.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1411318-1.html
 load 1468294-1.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 prefs =
   dom.animations-api.core.enabled=true
+  dom.animations-api.timelines.enabled=true
 # Support files for chrome tests that we want to load over HTTP need
 # to go in here, not chrome.ini.
 support-files =
   chrome/file_animate_xrays.html
   mozilla/xhr_doc.html
   mozilla/file_deferred_start.html
   mozilla/file_disable_animations_api_core.html
   mozilla/file_discrete_animations.html
--- a/dom/animation/test/mozilla/test_deferred_start.html
+++ b/dom/animation/test/mozilla/test_deferred_start.html
@@ -2,13 +2,19 @@
 <meta charset=utf-8>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
 'use strict';
 setup({explicit_done: true});
 SpecialPowers.pushPrefEnv(
-  { "set": [["dom.animations-api.core.enabled", true]]},
+  {
+    set: [
+      ["dom.animations-api.core.enabled", true],
+      ["dom.animations-api.timelines.enabled", true],
+    ],
+  },
   function() {
     window.open("file_deferred_start.html");
-  });
+  }
+);
 </script>
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -215,17 +215,18 @@ function propertyToIDL(property) {
 function waitForFrame() {
   return new Promise(function(resolve, reject) {
     window.requestAnimationFrame(resolve);
   });
 }
 
 /**
  * Waits for a requestAnimationFrame callback in the next refresh driver tick.
- * Note that 'dom.animations-api.core.enabled' pref should be true to use this
+ * Note that the 'dom.animations-api.core.enabled' and
+ * 'dom.animations-api.timelines.enabled' prefs should be true to use this
  * function.
  */
 function waitForNextFrame() {
   const timeAtStart = document.timeline.currentTime;
   return new Promise(resolve => {
     window.requestAnimationFrame(() => {
       if (timeAtStart === document.timeline.currentTime) {
         window.requestAnimationFrame(resolve);
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -297,16 +297,17 @@ bool nsContentUtils::sIsResourceTimingEn
 bool nsContentUtils::sIsPerformanceNavigationTimingEnabled = false;
 bool nsContentUtils::sIsFormAutofillAutocompleteEnabled = false;
 bool nsContentUtils::sIsShadowDOMEnabled = false;
 bool nsContentUtils::sIsCustomElementsEnabled = false;
 bool nsContentUtils::sSendPerformanceTimingNotifications = false;
 bool nsContentUtils::sUseActivityCursor = false;
 bool nsContentUtils::sAnimationsAPICoreEnabled = false;
 bool nsContentUtils::sAnimationsAPIElementAnimateEnabled = false;
+bool nsContentUtils::sAnimationsAPITimelinesEnabled = false;
 bool nsContentUtils::sGetBoxQuadsEnabled = false;
 bool nsContentUtils::sSkipCursorMoveForSameValueSet = false;
 bool nsContentUtils::sRequestIdleCallbackEnabled = false;
 bool nsContentUtils::sLowerNetworkPriority = false;
 bool nsContentUtils::sTailingEnabled = false;
 bool nsContentUtils::sShowInputPlaceholderOnFocus = true;
 bool nsContentUtils::sAutoFocusEnabled = true;
 #ifndef RELEASE_OR_BETA
@@ -765,16 +766,20 @@ nsContentUtils::Init()
                                "ui.use_activity_cursor", false);
 
   Preferences::AddBoolVarCache(&sAnimationsAPICoreEnabled,
                                "dom.animations-api.core.enabled", false);
 
   Preferences::AddBoolVarCache(&sAnimationsAPIElementAnimateEnabled,
                                "dom.animations-api.element-animate.enabled", false);
 
+  Preferences::AddBoolVarCache(&sAnimationsAPITimelinesEnabled,
+                               "dom.animations-api.timelines.enabled",
+                               false);
+
   Preferences::AddBoolVarCache(&sGetBoxQuadsEnabled,
                                "layout.css.getBoxQuads.enabled", false);
 
   Preferences::AddBoolVarCache(&sSkipCursorMoveForSameValueSet,
                                "dom.input.skip_cursor_move_for_same_value_set",
                                true);
 
   Preferences::AddBoolVarCache(&sRequestIdleCallbackEnabled,
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2365,16 +2365,25 @@ public:
    * Returns true if the DOM Animations Element.animate() API should be enabled.
    */
   static bool AnimationsAPIElementAnimateEnabled()
   {
     return sAnimationsAPIElementAnimateEnabled;
   }
 
   /**
+   * Returns true if the timelines component of the DOM Animations API should be
+   * enabled.
+   */
+  static bool AnimationsAPITimelinesEnabled()
+  {
+    return sAnimationsAPITimelinesEnabled;
+  }
+
+  /**
    * Returns true if the getBoxQuads API should be enabled.
    */
   static bool GetBoxQuadsEnabled()
   {
     return sGetBoxQuadsEnabled;
   }
 
   /**
@@ -3410,16 +3419,17 @@ private:
   static bool sIsFrameTimingPrefEnabled;
   static bool sIsFormAutofillAutocompleteEnabled;
   static bool sIsShadowDOMEnabled;
   static bool sIsCustomElementsEnabled;
   static bool sSendPerformanceTimingNotifications;
   static bool sUseActivityCursor;
   static bool sAnimationsAPICoreEnabled;
   static bool sAnimationsAPIElementAnimateEnabled;
+  static bool sAnimationsAPITimelinesEnabled;
   static bool sGetBoxQuadsEnabled;
   static bool sSkipCursorMoveForSameValueSet;
   static bool sRequestIdleCallbackEnabled;
   static bool sLowerNetworkPriority;
   static bool sTailingEnabled;
   static bool sShowInputPlaceholderOnFocus;
   static bool sAutoFocusEnabled;
 #ifndef RELEASE_OR_BETA
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3303,16 +3303,27 @@ bool
 nsDocument::IsWebAnimationsEnabled(CallerType aCallerType)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   return aCallerType == dom::CallerType::System ||
          nsContentUtils::AnimationsAPICoreEnabled();
 }
 
+bool
+nsDocument::AreWebAnimationsTimelinesEnabled(JSContext* aCx,
+                                             JSObject* /*unused*/
+)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+
+  return nsContentUtils::IsSystemCaller(aCx) ||
+         nsContentUtils::AnimationsAPITimelinesEnabled();
+}
+
 DocumentTimeline*
 nsIDocument::Timeline()
 {
   if (!mDocumentTimeline) {
     mDocumentTimeline = new DocumentTimeline(this, TimeDuration(0));
   }
 
   return mDocumentTimeline;
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -156,16 +156,18 @@ public:
                                      bool aReset = true,
                                      nsIContentSink* aContentSink = nullptr) override = 0;
 
   virtual void StopDocumentLoad() override;
 
   static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
   static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
   static bool IsWebAnimationsEnabled(mozilla::dom::CallerType aCallerType);
+  static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx,
+                                               JSObject* aObject);
 
   virtual void EndUpdate() override;
   virtual void BeginLoad() override;
   virtual void EndLoad() override;
 
   // nsIRadioGroupContainer
   NS_IMETHOD WalkRadioGroup(const nsAString& aName,
                             nsIRadioVisitor* aVisitor,
--- a/dom/webidl/Animation.webidl
+++ b/dom/webidl/Animation.webidl
@@ -14,17 +14,17 @@ enum AnimationPlayState { "idle", "runni
 
 [Func="nsDocument::IsElementAnimateEnabled",
  Constructor (optional AnimationEffect? effect = null,
               optional AnimationTimeline? timeline)]
 interface Animation : EventTarget {
   attribute DOMString id;
   [Func="nsDocument::IsWebAnimationsEnabled", Pure]
   attribute AnimationEffect? effect;
-  [Func="nsDocument::IsWebAnimationsEnabled"]
+  [Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
   attribute AnimationTimeline? timeline;
   [BinaryName="startTimeAsDouble"]
   attribute double? startTime;
   [SetterThrows, BinaryName="currentTimeAsDouble"]
   attribute double? currentTime;
 
            attribute double             playbackRate;
   [BinaryName="playStateFromJS"]
--- a/dom/webidl/AnimationTimeline.webidl
+++ b/dom/webidl/AnimationTimeline.webidl
@@ -5,13 +5,13 @@
  *
  * The origin of this IDL file is
  * https://drafts.csswg.org/web-animations/#animationtimeline
  *
  * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-[Func="nsDocument::IsWebAnimationsEnabled"]
+[Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
 interface AnimationTimeline {
   [BinaryName="currentTimeAsDouble"]
   readonly attribute double? currentTime;
 };
--- a/dom/webidl/DocumentTimeline.webidl
+++ b/dom/webidl/DocumentTimeline.webidl
@@ -9,12 +9,12 @@
  * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 dictionary DocumentTimelineOptions {
   DOMHighResTimeStamp originTime = 0;
 };
 
-[Func="nsDocument::IsWebAnimationsEnabled",
+[Func="nsDocument::AreWebAnimationsTimelinesEnabled",
  Constructor (optional DocumentTimelineOptions options)]
 interface DocumentTimeline : AnimationTimeline {
 };
--- a/dom/xslt/tests/mochitest/test_bug1135764.html
+++ b/dom/xslt/tests/mochitest/test_bug1135764.html
@@ -22,26 +22,32 @@ https://bugzilla.mozilla.org/show_bug.cg
       return;
     }
     ok(frames[0].document.timeline.currentTime !== startTimelineValue,
        "The timeline in an XSLT-transformed document should still advance");
     SimpleTest.finish();
   }
   addLoadEvent(function() {
     SpecialPowers.pushPrefEnv(
-      { "set": [[ "dom.animations-api.core.enabled", true]] },
+      {
+        set: [
+          ["dom.animations-api.core.enabled", true],
+          ["dom.animations-api.timelines.enabled", true],
+        ],
+      },
       function() {
         var ifr = document.querySelector("iframe");
         ifr.onload = function() {
           startTimelineValue = frames[0].document.timeline.currentTime;
           frames[0].requestAnimationFrame(waitATick);
-        }
+        };
         ifr.src = "file_bug1135764.xml";
-     })
-  })
+      }
+    );
+  });
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1135764">Mozilla Bug 1135764</a>
 <p id="display">
   <iframe></iframe>
 </p>
 <div id="content" style="display: none">
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -484,17 +484,17 @@ load 1288946-2a.html
 load 1288946-2b.html
 load 1297835.html
 load 1299736-1.html
 load 1308793.svg
 load 1308848-1.html
 load 1308848-2.html
 load 1338772-1.html
 load 1340571.html
-pref(dom.animations-api.core.enabled,true) load 1343139-1.html
+pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1343139-1.html
 asserts(0-1) load 1343606.html # bug 1343948
 load 1343937.html
 load 1352380.html
 load 1362423-1.html
 load 1381323.html
 load 1382534.html
 load 1388625-1.html
 load 1390389.html
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 prefs =
   dom.animations-api.core.enabled=true
+  dom.animations-api.timelines.enabled=true
 support-files =
   animation_utils.js
   ccd-quirks.html
   ccd.sjs
   ccd-standards.html
   chrome/bug418986-2.js
   chrome/match.png
   chrome/mismatch.png
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3074,16 +3074,23 @@ pref("dom.animations-api.core.enabled", 
 #endif
 
 // Is support for the Element.animate() function (a subset of the Web Animations
 // API) enabled?
 // Note that if dom.animations-api.core.enabled is true, this preference is
 // ignored.
 pref("dom.animations-api.element-animate.enabled", true);
 
+// Is support for timelines from the Web Animations API enabled?
+#ifdef RELEASE_OR_BETA
+pref("dom.animations-api.timelines.enabled", false);
+#else
+pref("dom.animations-api.timelines.enabled", true);
+#endif
+
 // Pref to throttle offsreen animations
 pref("dom.animations.offscreen-throttling", true);
 
 // Prefs to control the maximum area to pre-render when animating a large
 // element on the compositor.
 pref("layout.animation.prerender.partial", false);
 pref("layout.animation.prerender.viewport-ratio-limit-x", "1.125");
 pref("layout.animation.prerender.viewport-ratio-limit-y", "1.125");
--- a/testing/web-platform/meta/css/css-animations/__dir__.ini
+++ b/testing/web-platform/meta/css/css-animations/__dir__.ini
@@ -1,1 +1,2 @@
-prefs: [dom.animations-api.core.enabled:true]
+prefs: [dom.animations-api.core.enabled:true,
+        dom.animations-api.timelines.enabled:true]
--- a/testing/web-platform/meta/css/css-transitions/__dir__.ini
+++ b/testing/web-platform/meta/css/css-transitions/__dir__.ini
@@ -1,1 +1,2 @@
-prefs: [dom.animations-api.core.enabled:true]
+prefs: [dom.animations-api.core.enabled:true,
+        dom.animations-api.timelines.enabled:true]
--- a/testing/web-platform/meta/web-animations/__dir__.ini
+++ b/testing/web-platform/meta/web-animations/__dir__.ini
@@ -1,2 +1,3 @@
 prefs: [dom.animations-api.core.enabled:true,
+        dom.animations-api.timelines.enabled:true,
         layout.css.frames-timing.enabled:true]
--- a/testing/web-platform/tests/css/css-animations/support/testcommon.js
+++ b/testing/web-platform/tests/css/css-animations/support/testcommon.js
@@ -98,18 +98,16 @@ function addStyle(t, rules) {
 function waitForFrame() {
   return new Promise(function(resolve, reject) {
     window.requestAnimationFrame(resolve);
   });
 }
 
 /**
  * Waits for a requestAnimationFrame callback in the next refresh driver tick.
- * Note that 'dom.animations-api.core.enabled' pref should be true to use this
- * function.
  */
 function waitForNextFrame() {
   const timeAtStart = document.timeline.currentTime;
   return new Promise(resolve => {
     window.requestAnimationFrame(() => {
       if (timeAtStart === document.timeline.currentTime) {
         window.requestAnimationFrame(resolve);
       } else {