mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Pull rule_type into ParserContext
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to deeper levels of the parser. MozReview-Commit-ID: DjBNytLxGKX
This commit is contained in:
parent
a093b0a087
commit
4574cd8ea6
35 changed files with 125 additions and 97 deletions
|
@ -17,7 +17,7 @@ use dom_struct::dom_struct;
|
|||
use std::sync::Arc;
|
||||
use style::media_queries::parse_media_query_list;
|
||||
use style::shared_lock::{Locked, ToCssWithGuard};
|
||||
use style::stylesheets::MediaRule;
|
||||
use style::stylesheets::{CssRuleType, MediaRule};
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -68,6 +68,9 @@ impl CSSMediaRule {
|
|||
/// https://drafts.csswg.org/css-conditional-3/#the-cssmediarule-interface
|
||||
pub fn set_condition_text(&self, text: DOMString) {
|
||||
let mut input = Parser::new(&text);
|
||||
let win = self.global().as_window();
|
||||
let url = win.Document().url();
|
||||
let context = ParserContext::new_for_cssom(&url, win.css_error_reporter(), Some(CssRuleType::Media));
|
||||
let new_medialist = parse_media_query_list(&mut input);
|
||||
let mut guard = self.cssconditionrule.shared_lock().write();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue