From c056a64e2eacdd45543637d26aad6e40ea776561 Mon Sep 17 00:00:00 2001 From: Gregory Pappas Date: Fri, 9 Feb 2024 22:00:23 +0000 Subject: [PATCH] Bug 1873137 - Remove dom.animations-api.getAnimations.enabled pref r=webidl,emilio,firefox-animation-reviewers,devtools-reviewers,nchevobbe,boris Differential Revision: https://phabricator.services.mozilla.com/D201162 --- .../client/inspector/animation/test/head.js | 5 +---- dom/animation/test/crashtests/crashtests.list | 10 +++++----- dom/animation/test/mochitest.toml | 4 ---- ...disable_animations_api_get_animations.html | 20 ------------------- .../test/mozilla/test_deferred_start.html | 1 - ...disable_animations_api_get_animations.html | 14 ------------- dom/base/Document.cpp | 9 --------- dom/base/Document.h | 2 -- dom/base/test/test_bug1295852.html | 14 +++++-------- dom/base/test/test_domwindowutils.html | 1 - dom/bindings/parser/tests/test_constructor.py | 8 ++++---- dom/bindings/test/TestCodeGen.webidl | 8 ++++---- dom/smil/test/test_smilWithTransition.html | 6 +----- dom/webidl/Animatable.webidl | 1 - dom/webidl/CSSAnimation.webidl | 4 +--- dom/webidl/CSSTransition.webidl | 4 +--- dom/webidl/DocumentOrShadowRoot.webidl | 1 - .../mochitest/browser_test_group_fission.js | 1 - layout/style/crashtests/crashtests.list | 6 +++--- layout/style/test/mochitest.toml | 1 - modules/libpref/init/StaticPrefList.yaml | 7 ------- .../meta/css/css-animations/__dir__.ini | 2 +- .../meta/css/css-logical/__dir__.ini | 1 - .../meta/css/css-pseudo/idlharness.html.ini | 1 - .../meta/css/css-scoping/__dir__.ini | 1 - .../meta/css/css-transitions/__dir__.ini | 2 +- .../meta/web-animations/__dir__.ini | 2 +- 27 files changed, 28 insertions(+), 108 deletions(-) delete mode 100644 dom/animation/test/mozilla/file_disable_animations_api_get_animations.html delete mode 100644 dom/animation/test/mozilla/test_disable_animations_api_get_animations.html delete mode 100644 testing/web-platform/meta/css/css-scoping/__dir__.ini diff --git a/devtools/client/inspector/animation/test/head.js b/devtools/client/inspector/animation/test/head.js index b22134d89786..959ad270a5bc 100644 --- a/devtools/client/inspector/animation/test/head.js +++ b/devtools/client/inspector/animation/test/head.js @@ -70,10 +70,7 @@ const closeAnimationInspector = async function () { */ const enableAnimationFeatures = function () { return SpecialPowers.pushPrefEnv({ - set: [ - ["dom.animations-api.getAnimations.enabled", true], - ["dom.animations-api.timelines.enabled", true], - ], + set: [["dom.animations-api.timelines.enabled", true]], }); }; diff --git a/dom/animation/test/crashtests/crashtests.list b/dom/animation/test/crashtests/crashtests.list index 2ed9fb583687..be9b1c8ae9fd 100644 --- a/dom/animation/test/crashtests/crashtests.list +++ b/dom/animation/test/crashtests/crashtests.list @@ -15,7 +15,7 @@ load 1282691-1.html load 1291413-1.html load 1291413-2.html pref(dom.animations-api.compositing.enabled,true) load 1304886-1.html -pref(dom.animations-api.getAnimations.enabled,true) load 1309198-1.html +load 1309198-1.html load 1322382-1.html load 1322291-1.html load 1322291-2.html @@ -26,7 +26,7 @@ load 1324554-1.html pref(dom.animations-api.compositing.enabled,true) load 1325193-1.html load 1332588-1.html load 1330190-1.html -pref(dom.animations-api.compositing.enabled,true) pref(dom.animations-api.getAnimations.enabled,true) load 1330190-2.html +pref(dom.animations-api.compositing.enabled,true) load 1330190-2.html pref(dom.animations-api.compositing.enabled,true) load 1330513-1.html pref(dom.animations-api.timelines.enabled,true) load 1333539-1.html pref(dom.animations-api.timelines.enabled,true) load 1333539-2.html @@ -48,15 +48,15 @@ load 1524480-1.html load 1575926.html load 1585770.html load 1604500-1.html -pref(dom.animations-api.getAnimations.enabled,true) load 1611847.html +load 1611847.html load 1612891-1.html load 1612891-2.html load 1612891-3.html -pref(dom.animations-api.getAnimations.enabled,true) load 1633442.html +load 1633442.html load 1633486.html pref(layout.animation.prerender.partial,true) load 1656419.html load 1706157.html pref(gfx.omta.background-color,true) load 1699890.html -pref(dom.animations-api.getAnimations.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1714421.html +pref(dom.animations-api.timelines.enabled,true) load 1714421.html load 1807966.html load 1875441.html diff --git a/dom/animation/test/mochitest.toml b/dom/animation/test/mochitest.toml index 4678ff7927c0..1859525dfe35 100644 --- a/dom/animation/test/mochitest.toml +++ b/dom/animation/test/mochitest.toml @@ -1,7 +1,6 @@ [DEFAULT] prefs = [ "dom.animations-api.compositing.enabled=true", - "dom.animations-api.getAnimations.enabled=true", "dom.animations-api.timelines.enabled=true", "gfx.omta.background-color=true", "layout.css.individual-transform.enabled=true", @@ -15,7 +14,6 @@ support-files = [ "mozilla/xhr_doc.html", "mozilla/file_deferred_start.html", "mozilla/file_disable_animations_api_compositing.html", - "mozilla/file_disable_animations_api_get_animations.html", "mozilla/file_disable_animations_api_timelines.html", "mozilla/file_discrete_animations.html", "mozilla/file_transition_finish_on_compositor.html", @@ -37,8 +35,6 @@ skip-if = ["os == 'win' && bits == 64"] # Bug 1363957 ["mozilla/test_disable_animations_api_compositing.html"] -["mozilla/test_disable_animations_api_get_animations.html"] - ["mozilla/test_disable_animations_api_timelines.html"] ["mozilla/test_disabled_properties.html"] diff --git a/dom/animation/test/mozilla/file_disable_animations_api_get_animations.html b/dom/animation/test/mozilla/file_disable_animations_api_get_animations.html deleted file mode 100644 index 3d484444a79e..000000000000 --- a/dom/animation/test/mozilla/file_disable_animations_api_get_animations.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/dom/animation/test/mozilla/test_deferred_start.html b/dom/animation/test/mozilla/test_deferred_start.html index 7f9ab8a93a98..8b3d293f025f 100644 --- a/dom/animation/test/mozilla/test_deferred_start.html +++ b/dom/animation/test/mozilla/test_deferred_start.html @@ -9,7 +9,6 @@ setup({explicit_done: true}); SpecialPowers.pushPrefEnv( { set: [ - ["dom.animations-api.getAnimations.enabled", true], ["dom.animations-api.timelines.enabled", true], ], }, diff --git a/dom/animation/test/mozilla/test_disable_animations_api_get_animations.html b/dom/animation/test/mozilla/test_disable_animations_api_get_animations.html deleted file mode 100644 index a7253439b74c..000000000000 --- a/dom/animation/test/mozilla/test_disable_animations_api_get_animations.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -
- diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 11410c91ae9f..8ea0b69928bd 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -4463,15 +4463,6 @@ bool Document::AllowsL10n() const { return allowed; } -bool Document::IsWebAnimationsGetAnimationsEnabled(JSContext* aCx, - JSObject* /*unused*/ -) { - MOZ_ASSERT(NS_IsMainThread()); - - return nsContentUtils::IsSystemCaller(aCx) || - StaticPrefs::dom_animations_api_getAnimations_enabled(); -} - bool Document::AreWebAnimationsTimelinesEnabled(JSContext* aCx, JSObject* /*unused*/ ) { diff --git a/dom/base/Document.h b/dom/base/Document.h index c8e6a2f37ef8..c685d0a0adad 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -3423,8 +3423,6 @@ class Document : public nsINode, mozilla::dom::HTMLAllCollection* All(); static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject); - static bool IsWebAnimationsGetAnimationsEnabled(JSContext* aCx, - JSObject* aObject); static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx, JSObject* aObject); // Checks that the caller is either chrome or some addon. diff --git a/dom/base/test/test_bug1295852.html b/dom/base/test/test_bug1295852.html index e8049f30a8ca..a4991c6149d3 100644 --- a/dom/base/test/test_bug1295852.html +++ b/dom/base/test/test_bug1295852.html @@ -10,14 +10,10 @@ var names = [ "span", "_moz_generated_content_before", "_moz_generated_content_after" ]; -if (SpecialPowers.getBoolPref("dom.animations-api.getAnimations.enabled")) { - names.forEach(name => { - var element = document.createElement(name); - element.animate({ "color": ["red", "blue"] }, { duration: 1000 }); - is(element.getAnimations().length, 1); - }); -} else { - ok("Test requires Web Animations, which is disabled."); -} +names.forEach(name => { + var element = document.createElement(name); + element.animate({ "color": ["red", "blue"] }, { duration: 1000 }); + is(element.getAnimations().length, 1); +}); diff --git a/dom/base/test/test_domwindowutils.html b/dom/base/test/test_domwindowutils.html index 8d9f8c3f9cd0..21ad43ae81e5 100644 --- a/dom/base/test/test_domwindowutils.html +++ b/dom/base/test/test_domwindowutils.html @@ -81,7 +81,6 @@ function test_getUnanimatedComputedStyle() { SpecialPowers.pushPrefEnv( { set: [ - ["dom.animations-api.getAnimations.enabled", true], ["dom.animations-api.timelines.enabled", true], ["layout.css.properties-and-values.enabled", true], ], diff --git a/dom/bindings/parser/tests/test_constructor.py b/dom/bindings/parser/tests/test_constructor.py index ca2ccbe210e2..1a08a828fd14 100644 --- a/dom/bindings/parser/tests/test_constructor.py +++ b/dom/bindings/parser/tests/test_constructor.py @@ -264,7 +264,7 @@ def WebIDLTest(parser, harness): parser.parse( """ interface TestFuncConstructor { - [Func="Document::IsWebAnimationsGetAnimationsEnabled"] constructor(); + [Func="IsNotUAWidget"] constructor(); }; """ ) @@ -277,7 +277,7 @@ def WebIDLTest(parser, harness): "::TestFuncConstructor::constructor", "constructor", [("TestFuncConstructor (Wrapper)", [])], - func=["Document::IsWebAnimationsGetAnimationsEnabled"], + func=["IsNotUAWidget"], ) parser = parser.reset() @@ -286,7 +286,7 @@ def WebIDLTest(parser, harness): "\n" " interface TestPrefChromeOnlySCFuncConstructor {\n" ' [ChromeOnly, Pref="dom.webidl.test1", SecureContext, ' - 'Func="Document::IsWebAnimationsGetAnimationsEnabled"]\n' + 'Func="IsNotUAWidget"]\n' " constructor();\n" " };\n" ) @@ -300,7 +300,7 @@ def WebIDLTest(parser, harness): "::TestPrefChromeOnlySCFuncConstructor::constructor", "constructor", [("TestPrefChromeOnlySCFuncConstructor (Wrapper)", [])], - func=["Document::IsWebAnimationsGetAnimationsEnabled"], + func=["IsNotUAWidget"], pref=["dom.webidl.test1"], chromeOnly=True, secureContext=True, diff --git a/dom/bindings/test/TestCodeGen.webidl b/dom/bindings/test/TestCodeGen.webidl index f3559c4599b4..577be059205e 100644 --- a/dom/bindings/test/TestCodeGen.webidl +++ b/dom/bindings/test/TestCodeGen.webidl @@ -1505,7 +1505,7 @@ interface TestSCConstructorForInterface { [SecureContext] constructor(); }; -[Exposed=Window, Func="Document::IsWebAnimationsGetAnimationsEnabled"] +[Exposed=Window, Func="IsNotUAWidget"] interface TestConstructorForFuncInterface { // Since the interface has a Func attribute, but the constructor does not, // the generated constructor should not check for the Func. @@ -1516,7 +1516,7 @@ interface TestConstructorForFuncInterface { interface TestFuncConstructorForInterface { // Since the constructor has a Func attribute, but the interface does not, // the generated constructor should check for the Func. - [Func="Document::IsWebAnimationsGetAnimationsEnabled"] + [Func="IsNotUAWidget"] constructor(); }; @@ -1524,13 +1524,13 @@ interface TestFuncConstructorForInterface { interface TestFuncConstructorForDifferentFuncInterface { // Since the constructor has a different Func attribute from the interface, // the generated constructor should still check for its conditional func. - [Func="Document::IsWebAnimationsGetAnimationsEnabled"] + [Func="IsNotUAWidget"] constructor(); }; [Exposed=Window] interface TestPrefChromeOnlySCFuncConstructorForInterface { - [Pref="dom.webidl.test1", ChromeOnly, SecureContext, Func="Document::IsWebAnimationsGetAnimationsEnabled"] + [Pref="dom.webidl.test1", ChromeOnly, SecureContext, Func="IsNotUAWidget"] // There should be checks for all Pref/ChromeOnly/SecureContext/Func // in the generated constructor. constructor(); diff --git a/dom/smil/test/test_smilWithTransition.html b/dom/smil/test/test_smilWithTransition.html index f464f9a39d39..4378841f5067 100644 --- a/dom/smil/test/test_smilWithTransition.html +++ b/dom/smil/test/test_smilWithTransition.html @@ -9,10 +9,6 @@ 'use strict'; SimpleTest.waitForExplicitFinish(); -SpecialPowers.pushPrefEnv( - { "set": [["dom.animations-api.getAnimations.enabled", true]]}, - function() { - window.open("file_smilWithTransition.html"); - }); +window.open("file_smilWithTransition.html"); diff --git a/dom/webidl/Animatable.webidl b/dom/webidl/Animatable.webidl index 432c9ca85656..9d10bfc5ad6c 100644 --- a/dom/webidl/Animatable.webidl +++ b/dom/webidl/Animatable.webidl @@ -22,6 +22,5 @@ interface mixin Animatable { [Throws] Animation animate(object? keyframes, optional UnrestrictedDoubleOrKeyframeAnimationOptions options = {}); - [Func="Document::IsWebAnimationsGetAnimationsEnabled"] sequence getAnimations(optional GetAnimationsOptions options = {}); }; diff --git a/dom/webidl/CSSAnimation.webidl b/dom/webidl/CSSAnimation.webidl index f60b9ed0c899..f32b52aa33a3 100644 --- a/dom/webidl/CSSAnimation.webidl +++ b/dom/webidl/CSSAnimation.webidl @@ -10,9 +10,7 @@ * liability, trademark and document use rules apply. */ -[Func="Document::IsWebAnimationsGetAnimationsEnabled", - HeaderFile="nsAnimationManager.h", - Exposed=Window] +[HeaderFile="nsAnimationManager.h", Exposed=Window] interface CSSAnimation : Animation { [Constant] readonly attribute DOMString animationName; }; diff --git a/dom/webidl/CSSTransition.webidl b/dom/webidl/CSSTransition.webidl index 5c2f74173e3a..859d9ba08167 100644 --- a/dom/webidl/CSSTransition.webidl +++ b/dom/webidl/CSSTransition.webidl @@ -10,9 +10,7 @@ * liability, trademark and document use rules apply. */ -[Func="Document::IsWebAnimationsGetAnimationsEnabled", - HeaderFile="nsTransitionManager.h", - Exposed=Window] +[HeaderFile="nsTransitionManager.h", Exposed=Window] interface CSSTransition : Animation { [Constant] readonly attribute DOMString transitionProperty; }; diff --git a/dom/webidl/DocumentOrShadowRoot.webidl b/dom/webidl/DocumentOrShadowRoot.webidl index c0952ff11154..598d60e5c818 100644 --- a/dom/webidl/DocumentOrShadowRoot.webidl +++ b/dom/webidl/DocumentOrShadowRoot.webidl @@ -37,7 +37,6 @@ interface mixin DocumentOrShadowRoot { // https://drafts.csswg.org/web-animations-1/#extensions-to-the-documentorshadowroot-interface-mixin partial interface mixin DocumentOrShadowRoot { - [Func="Document::IsWebAnimationsGetAnimationsEnabled"] sequence getAnimations(); }; diff --git a/gfx/layers/apz/test/mochitest/browser_test_group_fission.js b/gfx/layers/apz/test/mochitest/browser_test_group_fission.js index 43bbcbe444a1..c6b838dd75a4 100644 --- a/gfx/layers/apz/test/mochitest/browser_test_group_fission.js +++ b/gfx/layers/apz/test/mochitest/browser_test_group_fission.js @@ -4,7 +4,6 @@ add_task(async function setup_pref() { // To avoid throttling requestAnimationFrame callbacks in invisible // iframes ["layout.throttled_frame_rate", 60], - ["dom.animations-api.getAnimations.enabled", true], ["dom.animations-api.timelines.enabled", true], // Next two prefs are needed for hit-testing to work ["test.events.async.enabled", true], diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index db0d754905eb..3e7d1e2669fd 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -130,7 +130,7 @@ load 1146101-1.html load 1153693-1.html load 1156969.svg load 1161320-1.html -pref(dom.animations-api.getAnimations.enabled,true) load 1161320-2.html +load 1161320-2.html load 1161366-1.html load 1163446-1.html load 1164813-1.html @@ -158,7 +158,7 @@ load 1265611-1.html load 1270795.html load 1275026.html load 1278463-1.html -pref(dom.animations-api.getAnimations.enabled,true) load 1277908-1.html +load 1277908-1.html load 1277908-2.html load 1282076-1.html load 1282076-2.html @@ -276,7 +276,7 @@ load 1413361.html load 1413670.html load 1415353.html skip-if(wayland) load 1418059.html # wayland: bug 1856389 -skip-if(wayland) test-pref(dom.animations-api.getAnimations.enabled,true) load 1418867.html # wayland: bug 1856389 +skip-if(wayland) load 1418867.html # wayland: bug 1856389 load 1419554.html load 1426312.html load 1439793.html diff --git a/layout/style/test/mochitest.toml b/layout/style/test/mochitest.toml index 7a379c3c99a1..ae666b39db76 100644 --- a/layout/style/test/mochitest.toml +++ b/layout/style/test/mochitest.toml @@ -1,7 +1,6 @@ [DEFAULT] prefs = [ "dom.animations-api.compositing.enabled=true", - "dom.animations-api.getAnimations.enabled=true", "dom.animations-api.timelines.enabled=true", "gfx.omta.background-color=true", "gfx.font_loader.delay=0", diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index ddff1a66656e..6c6bf94a6aff 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -2153,13 +2153,6 @@ value: true mirror: always -# Is support for Document.getAnimations() and Element.getAnimations() -# supported? -- name: dom.animations-api.getAnimations.enabled - type: bool - value: true - mirror: always - # Is support for timelines from the Web Animations API enabled? - name: dom.animations-api.timelines.enabled type: bool diff --git a/testing/web-platform/meta/css/css-animations/__dir__.ini b/testing/web-platform/meta/css/css-animations/__dir__.ini index 7edda7fc7138..1fd72723f04e 100644 --- a/testing/web-platform/meta/css/css-animations/__dir__.ini +++ b/testing/web-platform/meta/css/css-animations/__dir__.ini @@ -1 +1 @@ -prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.getAnimations.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false, layout.css.animation-composition.enabled:true, layout.css.properties-and-values.enabled:true] +prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false, layout.css.animation-composition.enabled:true, layout.css.properties-and-values.enabled:true] diff --git a/testing/web-platform/meta/css/css-logical/__dir__.ini b/testing/web-platform/meta/css/css-logical/__dir__.ini index d6fbddbabd34..daf68383df9a 100644 --- a/testing/web-platform/meta/css/css-logical/__dir__.ini +++ b/testing/web-platform/meta/css/css-logical/__dir__.ini @@ -1,2 +1 @@ -prefs: [dom.animations-api.getAnimations.enabled:true] leak-threshold: [default:51200] diff --git a/testing/web-platform/meta/css/css-pseudo/idlharness.html.ini b/testing/web-platform/meta/css/css-pseudo/idlharness.html.ini index 561fd66eafba..cee1ef2f1953 100644 --- a/testing/web-platform/meta/css/css-pseudo/idlharness.html.ini +++ b/testing/web-platform/meta/css/css-pseudo/idlharness.html.ini @@ -1,4 +1,3 @@ -prefs: [dom.animations-api.getAnimations.enabled:true] [idlharness.html] expected: if (os == "android") and fission: [TIMEOUT, OK] diff --git a/testing/web-platform/meta/css/css-scoping/__dir__.ini b/testing/web-platform/meta/css/css-scoping/__dir__.ini deleted file mode 100644 index 7f53405b447e..000000000000 --- a/testing/web-platform/meta/css/css-scoping/__dir__.ini +++ /dev/null @@ -1 +0,0 @@ -prefs: [dom.animations-api.getAnimations.enabled:true] diff --git a/testing/web-platform/meta/css/css-transitions/__dir__.ini b/testing/web-platform/meta/css/css-transitions/__dir__.ini index 2561964e3b31..d477628216e7 100644 --- a/testing/web-platform/meta/css/css-transitions/__dir__.ini +++ b/testing/web-platform/meta/css/css-transitions/__dir__.ini @@ -1 +1 @@ -prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.getAnimations.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false] +prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false] diff --git a/testing/web-platform/meta/web-animations/__dir__.ini b/testing/web-platform/meta/web-animations/__dir__.ini index eaafc045275b..28a920505256 100644 --- a/testing/web-platform/meta/web-animations/__dir__.ini +++ b/testing/web-platform/meta/web-animations/__dir__.ini @@ -1 +1 @@ -prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.getAnimations.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false, layout.css.properties-and-values.enabled:true] +prefs: [dom.animations-api.compositing.enabled:true, dom.animations-api.timelines.enabled:true, layout.css.marker.restricted:false, layout.css.properties-and-values.enabled:true]