mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #18142 - emilio:less-mess-ns, r=SimonSapin
style: Less messy namespace handling. This PR accounts for the fact that the namespace table is only needed in `NestedRuleParser`, and only for style rules, in order to simplify the setup and be able to fix a few bugs wrt parsing of invalid rules. <!-- 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/18142) <!-- Reviewable:end -->
This commit is contained in:
commit
941e0dbb5a
9 changed files with 170 additions and 86 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