Auto merge of #20586 - emilio:moz-gradient-pref, r=xidorn

style: Respect the -moz- gradient pref again.

This hopefully allows us to unship them eventually.

Bug: 1451874
Reviewed-by: xidorn
MozReview-Commit-ID: 2MDRZLmLMM0

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20586)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-04-07 11:07:55 -04:00 committed by GitHub
commit 954ac8157f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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