style: Respect the -moz- gradient pref again.

This hopefully allows us to unship them eventually.

Bug: 1451874
Reviewed-by: xidorn
MozReview-Commit-ID: 2MDRZLmLMM0
This commit is contained in:
Emilio Cobos Álvarez 2018-04-07 14:31:14 +02:00
parent ccc9d1c4c2
commit 3927b3453a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -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)?,