summaryrefslogtreecommitdiff
path: root/dom/base
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-01-14 16:05:53 +0000
committerMoonchild <moonchild@palemoon.org>2021-01-14 16:05:53 +0000
commit407c86641a77a7d95db5f31b14f9f9f10c79d1e3 (patch)
tree8f5fd1a3ad9e556e6f8ee59229bd1fd3ed1f67e8 /dom/base
parentb0fe759f033f36a9a85afd7cc358b4800def5013 (diff)
downloaduxp-407c86641a77a7d95db5f31b14f9f9f10c79d1e3.tar.gz
Issue #1689 - Part 2: Add a preference for implicit keyframes
This preference controls whether authors are allowed to specify animations without a 0% or 100% keyframe. We intend to ship this but it isn't implemented yet (needs a follow-up) but this preference acts as a safeguard in case we discover we need to disable it once it's implemented.
Diffstat (limited to 'dom/base')
-rw-r--r--dom/base/nsDocument.cpp9
-rw-r--r--dom/base/nsDocument.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index 4d6579a898..43f11c0313 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -2932,6 +2932,15 @@ nsDocument::AreWebAnimationsTimelinesEnabled(JSContext* /*unused*/, JSObject* /*
Preferences::GetBool("dom.animations-api.timelines.enabled");
}
+bool
+nsDocument::AreWebAnimationsImplicitKeyframesEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ return nsContentUtils::IsCallerChrome() ||
+ Preferences::GetBool("dom.animations-api.implicit-keyframes.enabled");
+}
+
DocumentTimeline*
nsDocument::Timeline()
{
diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h
index a1fb04c6b0..f544166c20 100644
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -433,6 +433,7 @@ public:
static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
+ static bool AreWebAnimationsImplicitKeyframesEnabled(JSContext* aCx, JSObject* aObject);
static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx, JSObject* aObject);
virtual mozilla::dom::DocumentTimeline* Timeline() override;