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:
J. Ryan Stinnett 2017-04-10 09:24:32 +08:00
parent a093b0a087
commit 4574cd8ea6
35 changed files with 125 additions and 97 deletions

View file

@ -6,7 +6,7 @@ use cssparser::Parser;
use media_queries::CSSErrorReporterTest;
use servo_url::ServoUrl;
use style::parser::ParserContext;
use style::stylesheets::Origin;
use style::stylesheets::{CssRuleType, Origin};
use style_traits::ToCss;
#[test]
@ -20,7 +20,7 @@ fn test_column_width() {
let url = ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
let context = ParserContext::new(Origin::Author, &url, &reporter);
let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
let mut negative = Parser::new("-6px");
assert!(column_width::parse(&context, &mut negative).is_err());
@ -37,7 +37,7 @@ fn test_column_gap() {
let url = ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
let context = ParserContext::new(Origin::Author, &url, &reporter);
let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
let mut negative = Parser::new("-6px");
assert!(column_gap::parse(&context, &mut negative).is_err());