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.
This commit is contained in:
Moonchild 2021-01-14 16:05:53 +00:00 • committed by roytam1
commit d9693c298c
5 changed files with 35 additions and 10 deletions

View file

@ -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()
{