mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
parent
e4d5e9699b
commit
b45686f243
1 changed files with 20 additions and 5 deletions
|
@ -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())))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue