mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
style: Enable chrome-only CSS features in user stylesheets.
MozReview-Commit-ID: FJ4vTiOrotH Reviewed-by: heycam Bug: 1418963
This commit is contained in:
parent
b74e71fdd1
commit
c7a3c929f6
5 changed files with 52 additions and 29 deletions
|
@ -1158,7 +1158,7 @@ impl PropertyId {
|
|||
Some(context) => context,
|
||||
None => {
|
||||
default = PropertyParserContext {
|
||||
in_chrome_stylesheet: false,
|
||||
chrome_rules_enabled: false,
|
||||
stylesheet_origin: Origin::Author,
|
||||
rule_type: CssRuleType::Style,
|
||||
};
|
||||
|
@ -1346,7 +1346,7 @@ impl PropertyId {
|
|||
return Ok(())
|
||||
}
|
||||
|
||||
if context.in_chrome_stylesheet && ENABLED_IN_CHROME.contains(id) {
|
||||
if context.chrome_rules_enabled && ENABLED_IN_CHROME.contains(id) {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
|
@ -1357,7 +1357,7 @@ impl PropertyId {
|
|||
/// Parsing Context for PropertyId.
|
||||
pub struct PropertyParserContext {
|
||||
/// Whether the property is parsed in a chrome:// stylesheet.
|
||||
pub in_chrome_stylesheet: bool,
|
||||
pub chrome_rules_enabled: bool,
|
||||
/// The Origin of the stylesheet, whether it's a user,
|
||||
/// author or user-agent stylesheet.
|
||||
pub stylesheet_origin: Origin,
|
||||
|
@ -1369,7 +1369,7 @@ impl PropertyParserContext {
|
|||
/// Creates a PropertyParserContext with given stylesheet origin and rule type.
|
||||
pub fn new(context: &ParserContext) -> Self {
|
||||
Self {
|
||||
in_chrome_stylesheet: context.in_chrome_stylesheet(),
|
||||
chrome_rules_enabled: context.chrome_rules_enabled(),
|
||||
stylesheet_origin: context.stylesheet_origin,
|
||||
rule_type: context.rule_type(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue