Update to selectors 0.15

This commit is contained in:
Simon Sapin 2016-11-21 19:11:35 +01:00
parent a89ba50180
commit 82b13d50e3
21 changed files with 215 additions and 146 deletions

View file

@ -5,11 +5,12 @@
use cssparser::Parser;
use html5ever_atoms::LocalName;
use parking_lot::RwLock;
use selectors::parser::{LocalName as LocalNameSelector, ParserContext, parse_selector_list};
use selectors::parser::LocalName as LocalNameSelector;
use servo_atoms::Atom;
use std::sync::Arc;
use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, DeclaredValue};
use style::properties::{longhands, Importance};
use style::selector_parser::SelectorParser;
use style::stylesheets::StyleRule;
use style::stylist::{Rule, SelectorMap};
use style::thread_state;
@ -18,9 +19,7 @@ use style::thread_state;
/// Each sublist of the result contains the Rules for one StyleRule.
fn get_mock_rules(css_selectors: &[&str]) -> Vec<Vec<Rule>> {
css_selectors.iter().enumerate().map(|(i, selectors)| {
let context = ParserContext::new();
let selectors =
parse_selector_list(&context, &mut Parser::new(*selectors)).unwrap();
let selectors = SelectorParser::parse_author_origin_no_namespace(selectors).unwrap().0;
let rule = Arc::new(RwLock::new(StyleRule {
selectors: selectors,