mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Make ParsingMode bitflags.
assert_parsing_mode_match() is mostly the same as assert_restyle_hints_match().
This commit is contained in:
parent
fcc50ea421
commit
b6b3187efa
19 changed files with 88 additions and 58 deletions
|
@ -7,14 +7,14 @@
|
|||
use cssparser::Parser;
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use style::context::QuirksMode;
|
||||
use style::parser::{ParsingMode, ParserContext};
|
||||
use style::parser::{PARSING_MODE_DEFAULT, ParserContext};
|
||||
use style::stylesheets::{CssRuleType, Origin};
|
||||
|
||||
fn parse<T, F: Fn(&ParserContext, &mut Parser) -> Result<T, ()>>(f: F, s: &str) -> Result<T, ()> {
|
||||
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
|
||||
let reporter = CSSErrorReporterTest;
|
||||
let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style),
|
||||
ParsingMode::Default,
|
||||
PARSING_MODE_DEFAULT,
|
||||
QuirksMode::NoQuirks);
|
||||
let mut parser = Parser::new(s);
|
||||
f(&context, &mut parser)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue