Auto merge of #19434 - emilio:moz-document, r=xidorn

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

Bug: 1035091
Reviewed-by: xidorn
MozReview-Commit-ID: AAUs1jJifjS

<!-- 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/19434)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-11-30 07:24:27 -06:00 committed by GitHub
commit 3b78cf1045
2 changed files with 24 additions and 6 deletions

File diff suppressed because one or more lines are too long

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())))
}