From 5582de5d7eb89d948d8175d9cda679ecb9f85e3e Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Wed, 20 Nov 2019 22:38:26 +0000 Subject: [PATCH] style: Add a preference for offset-path:ray(). Differential Revision: https://phabricator.services.mozilla.com/D53110 --- components/style/values/specified/motion.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/style/values/specified/motion.rs b/components/style/values/specified/motion.rs index 90652b5ed64e..2351acecc6a2 100644 --- a/components/style/values/specified/motion.rs +++ b/components/style/values/specified/motion.rs @@ -16,11 +16,24 @@ use style_traits::{ParseError, StyleParseErrorKind}; /// The specified value of `offset-path`. pub type OffsetPath = GenericOffsetPath; +#[cfg(feature = "gecko")] +fn is_ray_enabled() -> bool { + static_prefs::pref!("layout.css.motion-path-ray.enabled") +} +#[cfg(feature = "servo")] +fn is_ray_enabled() -> bool { + false +} + impl Parse for RayFunction { fn parse<'i, 't>( context: &ParserContext, input: &mut Parser<'i, 't>, ) -> Result> { + if !is_ray_enabled() { + return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)); + } + let mut angle = None; let mut size = None; let mut contain = false;