From 3927b3453a530a3db3ead5de14515287da712f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 7 Apr 2018 14:31:14 +0200 Subject: [PATCH] style: Respect the -moz- gradient pref again. This hopefully allows us to unship them eventually. Bug: 1451874 Reviewed-by: xidorn MozReview-Commit-ID: 2MDRZLmLMM0 --- components/style/values/specified/image.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 844e50cbf79..9bf565ac635 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -227,9 +227,21 @@ impl Parse for Gradient { let (shape, repeating, mut compat_mode) = match result { Some(result) => result, - None => return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func.clone()))), + None => return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedFunction(func))), }; + #[cfg(feature = "gecko")] + { + use gecko_bindings::structs; + if compat_mode == CompatMode::Moz && + !unsafe { structs::StaticPrefs_sVarCache_layout_css_prefixes_gradients } + { + return Err(input.new_custom_error( + StyleParseErrorKind::UnexpectedFunction(func) + )); + } + } + let (kind, items) = input.parse_nested_block(|i| { let shape = match shape { Shape::Linear => GradientKind::parse_linear(context, i, &mut compat_mode)?,