summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-01-14 14:46:52 +0000
committerMoonchild <moonchild@palemoon.org>2021-01-14 14:46:52 +0000
commitb0fe759f033f36a9a85afd7cc358b4800def5013 (patch)
treeefc8d2e0668b2f4506388cc92d6087809f84ee50 /dom
parent51581427794bb41142285bc837e9cf461d8abe7a (diff)
downloadUXP-b0fe759f033f36a9a85afd7cc358b4800def5013.tar
UXP-b0fe759f033f36a9a85afd7cc358b4800def5013.tar.gz
UXP-b0fe759f033f36a9a85afd7cc358b4800def5013.tar.lz
UXP-b0fe759f033f36a9a85afd7cc358b4800def5013.tar.xz
UXP-b0fe759f033f36a9a85afd7cc358b4800def5013.zip
Issue #1689 - Part 1: Add pref for DOM Animation timelines API
Default false, no intent to ship for web content. Always enabled for Chrome.
Diffstat (limited to 'dom')
-rw-r--r--dom/animation/test/crashtests/crashtests.list14
-rw-r--r--dom/base/nsDocument.cpp9
-rw-r--r--dom/base/nsDocument.h2
-rw-r--r--dom/webidl/Animation.webidl2
-rw-r--r--dom/webidl/AnimationTimeline.webidl2
-rw-r--r--dom/webidl/Document.webidl2
-rw-r--r--dom/webidl/DocumentTimeline.webidl2
-rw-r--r--dom/xslt/tests/mochitest/test_bug1135764.html2
8 files changed, 23 insertions, 12 deletions
diff --git a/dom/animation/test/crashtests/crashtests.list b/dom/animation/test/crashtests/crashtests.list
index f61d7f876..29b18769a 100644
--- a/dom/animation/test/crashtests/crashtests.list
+++ b/dom/animation/test/crashtests/crashtests.list
@@ -1,13 +1,13 @@
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 1290535-1.html
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index 0fed2db01..4d6579a89 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -2923,6 +2923,15 @@ nsDocument::IsWebAnimationsEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
Preferences::GetBool("dom.animations-api.core.enabled");
}
+bool
+nsDocument::AreWebAnimationsTimelinesEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ return nsContentUtils::IsCallerChrome() ||
+ Preferences::GetBool("dom.animations-api.timelines.enabled");
+}
+
DocumentTimeline*
nsDocument::Timeline()
{
diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h
index 951ed2616..a1fb04c6b 100644
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -433,6 +433,8 @@ public:
static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
+ static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx, JSObject* aObject);
+
virtual mozilla::dom::DocumentTimeline* Timeline() override;
virtual void GetAnimations(
nsTArray<RefPtr<mozilla::dom::Animation>>& aAnimations) override;
diff --git a/dom/webidl/Animation.webidl b/dom/webidl/Animation.webidl
index 615084f75..9fdea5ade 100644
--- a/dom/webidl/Animation.webidl
+++ b/dom/webidl/Animation.webidl
@@ -19,7 +19,7 @@ interface Animation : EventTarget {
attribute DOMString id;
[Func="nsDocument::IsWebAnimationsEnabled", Pure]
attribute AnimationEffectReadOnly? effect;
- [Func="nsDocument::IsWebAnimationsEnabled"]
+ [Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
attribute AnimationTimeline? timeline;
[BinaryName="startTimeAsDouble"]
attribute double? startTime;
diff --git a/dom/webidl/AnimationTimeline.webidl b/dom/webidl/AnimationTimeline.webidl
index fe3d0fb49..4cf5567ce 100644
--- a/dom/webidl/AnimationTimeline.webidl
+++ b/dom/webidl/AnimationTimeline.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[Func="nsDocument::IsWebAnimationsEnabled"]
+[Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
interface AnimationTimeline {
[BinaryName="currentTimeAsDouble"]
readonly attribute double? currentTime;
diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl
index 26985202b..46db00876 100644
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -312,7 +312,7 @@ partial interface Document {
// http://w3c.github.io/web-animations/#extensions-to-the-document-interface
partial interface Document {
- [Func="nsDocument::IsWebAnimationsEnabled"]
+ [Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
readonly attribute DocumentTimeline timeline;
[Func="nsDocument::IsWebAnimationsEnabled"]
sequence<Animation> getAnimations();
diff --git a/dom/webidl/DocumentTimeline.webidl b/dom/webidl/DocumentTimeline.webidl
index 916b1a491..f10e2b365 100644
--- a/dom/webidl/DocumentTimeline.webidl
+++ b/dom/webidl/DocumentTimeline.webidl
@@ -14,7 +14,7 @@ dictionary DocumentTimelineOptions {
DOMHighResTimeStamp originTime = 0;
};
-[Func="nsDocument::IsWebAnimationsEnabled",
+[Func="nsDocument::AreWebAnimationsTimelinesEnabled",
Constructor (optional DocumentTimelineOptions options)]
interface DocumentTimeline : AnimationTimeline {
};
diff --git a/dom/xslt/tests/mochitest/test_bug1135764.html b/dom/xslt/tests/mochitest/test_bug1135764.html
index 5a7410e37..b1f627c87 100644
--- a/dom/xslt/tests/mochitest/test_bug1135764.html
+++ b/dom/xslt/tests/mochitest/test_bug1135764.html
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1135764
}
addLoadEvent(function() {
SpecialPowers.pushPrefEnv(
- { "set": [[ "dom.animations-api.core.enabled", true]] },
+ { "set": [[ "dom.animations-api.timelines.enabled", true]] },
function() {
var ifr = document.querySelector("iframe");
ifr.onload = function() {