mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Upgrade to rust-cssparser master.
* Use associated types * Avoid mutation to gather parsing results.
This commit is contained in:
parent
7359f99f20
commit
966af0030a
11 changed files with 183 additions and 165 deletions
|
@ -1166,16 +1166,12 @@ mod tests {
|
|||
/// Helper method to get some Rules from selector strings.
|
||||
/// Each sublist of the result contains the Rules for one StyleRule.
|
||||
fn get_mock_rules(css_selectors: &[&str]) -> Vec<Vec<Rule>> {
|
||||
use namespaces::NamespaceMap;
|
||||
use selectors::parse_selector_list;
|
||||
use stylesheets::Origin;
|
||||
|
||||
css_selectors.iter().enumerate().map(|(i, selectors)| {
|
||||
let context = ParserContext {
|
||||
stylesheet_origin: Origin::Author,
|
||||
namespaces: NamespaceMap::new(),
|
||||
base_url: &Url::parse("about:blank").unwrap(),
|
||||
};
|
||||
let url = Url::parse("about:blank").unwrap();
|
||||
let context = ParserContext::new(Origin::Author, &url);
|
||||
parse_selector_list(&context, &mut Parser::new(*selectors))
|
||||
.unwrap().into_iter().map(|s| {
|
||||
Rule {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue