style: Add a preference for offset-path:ray().

Differential Revision: https://phabricator.services.mozilla.com/D53110
This commit is contained in:
Boris Chiou 2019-11-20 22:38:26 +00:00 committed by Emilio Cobos Álvarez
parent f8ceb5cb84
commit 5582de5d7e
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -16,11 +16,24 @@ use style_traits::{ParseError, StyleParseErrorKind};
/// The specified value of `offset-path`.
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> {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if !is_ray_enabled() {
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
let mut angle = None;
let mut size = None;
let mut contain = false;