style: Disable @-moz-document on author sheets on nightly and early beta.

Bug: 1035091
Reviewed-by: xidorn
MozReview-Commit-ID: AAUs1jJifjS
This commit is contained in:
Emilio Cobos Álvarez 2017-11-29 22:16:46 +01:00
parent e4d5e9699b
commit b45686f243
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -424,12 +424,27 @@ impl<'a, 'b, 'i, R: ParseErrorReporter> AtRuleParser<'i> for NestedRuleParser<'a
}
},
"-moz-document" => {
if cfg!(feature = "gecko") {
let cond = DocumentCondition::parse(self.context, input)?;
Ok(AtRuleType::WithBlock(AtRuleBlockPrelude::Document(cond, location)))
} else {
Err(input.new_custom_error(StyleParseErrorKind::UnsupportedAtRule(name.clone())))
if !cfg!(feature = "gecko") {
return Err(input.new_custom_error(
StyleParseErrorKind::UnsupportedAtRule(name.clone())
))
}
#[cfg(feature = "gecko")]
{
use gecko_bindings::structs;
if self.stylesheet_origin == Origin::Author &&
unsafe { !structs::StylePrefs_sMozDocumentEnabledInContent }
{
return Err(input.new_custom_error(
StyleParseErrorKind::UnsupportedAtRule(name.clone())
))
}
}
let cond = DocumentCondition::parse(self.context, input)?;
Ok(AtRuleType::WithBlock(AtRuleBlockPrelude::Document(cond, location)))
},
_ => Err(input.new_custom_error(StyleParseErrorKind::UnsupportedAtRule(name.clone())))
}