Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-11-03 03:10:29 +01:00 committed by Martin Robinson
parent a41194a318
commit 7b28572309

View file

@ -16,12 +16,21 @@ use style_traits::{ParseError, StyleParseErrorKind};
/// The specified value of `offset-path`. /// The specified value of `offset-path`.
pub type OffsetPath = GenericOffsetPath<Angle>; pub type OffsetPath = GenericOffsetPath<Angle>;
#[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<Angle> { impl Parse for RayFunction<Angle> {
fn parse<'i, 't>( fn parse<'i, 't>(
context: &ParserContext, context: &ParserContext,
input: &mut Parser<'i, 't>, input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> { ) -> Result<Self, ParseError<'i>> {
if !static_prefs::pref!("layout.css.motion-path-ray.enabled") { if !is_ray_enabled() {
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)); return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
} }