mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Cleanup ParserContext::new_with_rule_type.
This commit is contained in:
parent
4763d05cf0
commit
a962c54928
8 changed files with 118 additions and 40 deletions
|
@ -36,9 +36,13 @@ impl CSS {
|
|||
decl.push_str(&value);
|
||||
let decl = Declaration(decl);
|
||||
let url = win.Document().url();
|
||||
let context = ParserContext::new_for_cssom(&url, win.css_error_reporter(), Some(CssRuleType::Supports),
|
||||
PARSING_MODE_DEFAULT,
|
||||
QuirksMode::NoQuirks);
|
||||
let context = ParserContext::new_for_cssom(
|
||||
&url,
|
||||
win.css_error_reporter(),
|
||||
Some(CssRuleType::Style),
|
||||
PARSING_MODE_DEFAULT,
|
||||
QuirksMode::NoQuirks
|
||||
);
|
||||
decl.eval(&context)
|
||||
}
|
||||
|
||||
|
@ -49,9 +53,13 @@ impl CSS {
|
|||
let cond = parse_condition_or_declaration(&mut input);
|
||||
if let Ok(cond) = cond {
|
||||
let url = win.Document().url();
|
||||
let context = ParserContext::new_for_cssom(&url, win.css_error_reporter(), Some(CssRuleType::Supports),
|
||||
PARSING_MODE_DEFAULT,
|
||||
QuirksMode::NoQuirks);
|
||||
let context = ParserContext::new_for_cssom(
|
||||
&url,
|
||||
win.css_error_reporter(),
|
||||
Some(CssRuleType::Style),
|
||||
PARSING_MODE_DEFAULT,
|
||||
QuirksMode::NoQuirks
|
||||
);
|
||||
cond.eval(&context)
|
||||
} else {
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue