diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index 7177e4b0b030..4a73c3ae7cd8 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -8,6 +8,7 @@ prefs = gfx.omta.background-color=true layout.css.individual-transform.enabled=true layout.css.motion-path.enabled=true + layout.css.motion-path-ray.enabled=true layout.css.overflow-logical.enabled=true layout.css.step-position-jump.enabled=true layout.css.text-underline-offset.enabled=true diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 81170c8527aa..a76b380fcbdb 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -4935,9 +4935,16 @@ # Is support for motion-path enabled? - name: layout.css.motion-path.enabled type: bool - value: @IS_NOT_RELEASE_OR_BETA@ + value: @IS_NIGHTLY_BUILD@ mirror: always +# Is support for motion-path ray() enabled? +- name: layout.css.motion-path-ray.enabled + type: RelaxedAtomicBool + value: @IS_NIGHTLY_BUILD@ + mirror: always + rust: true + # Expose the media query -moz-touch-enabled to web content. - name: layout.css.moz-touch-enabled.enabled type: RelaxedAtomicBool diff --git a/servo/components/style/values/specified/motion.rs b/servo/components/style/values/specified/motion.rs index 90652b5ed64e..2351acecc6a2 100644 --- a/servo/components/style/values/specified/motion.rs +++ b/servo/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; diff --git a/testing/web-platform/meta/css/motion/__dir__.ini b/testing/web-platform/meta/css/motion/__dir__.ini index f72fda0a8d2b..1f82e6dc9dee 100644 --- a/testing/web-platform/meta/css/motion/__dir__.ini +++ b/testing/web-platform/meta/css/motion/__dir__.ini @@ -1 +1 @@ -prefs: [layout.css.motion-path.enabled:true, layout.css.individual-transform.enabled:true, dom.animations-api.core.enabled:true] +prefs: [layout.css.motion-path.enabled:true, layout.css.individual-transform.enabled:true, dom.animations-api.core.enabled:true, layout.css.motion-path-ray.enabled:true]