mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add an extra data field to ParserContext.
This will be used for passing Gecko-specific information through the CSS parser in stylo.
This commit is contained in:
parent
a636b7127e
commit
bb85f5faf0
10 changed files with 91 additions and 27 deletions
|
@ -17,6 +17,7 @@ use layout_interface::{LayoutChan, Msg};
|
|||
use std::sync::Arc;
|
||||
use string_cache::Atom;
|
||||
use style::media_queries::parse_media_query_list;
|
||||
use style::parser::ParserContextExtraData;
|
||||
use style::servo::Stylesheet;
|
||||
use style::stylesheets::Origin;
|
||||
use util::str::DOMString;
|
||||
|
@ -60,7 +61,8 @@ impl HTMLStyleElement {
|
|||
};
|
||||
|
||||
let data = node.GetTextContent().expect("Element.textContent must be a string");
|
||||
let mut sheet = Stylesheet::from_str(&data, url, Origin::Author, win.css_error_reporter());
|
||||
let mut sheet = Stylesheet::from_str(&data, url, Origin::Author, win.css_error_reporter(),
|
||||
ParserContextExtraData::default());
|
||||
let mut css_parser = CssParser::new(&mq_str);
|
||||
let media = parse_media_query_list(&mut css_parser);
|
||||
sheet.set_media(Some(media));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue