Defined new trait ParseErrorReporter and added error_reporter member to ParserContext

This commit is contained in:
GauriGNaik 2015-10-26 11:31:28 -04:00 committed by Josh Matthews
parent 8efc954531
commit 996e9e06b2
24 changed files with 194 additions and 69 deletions

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use cssparser;
use media_queries::CSSErrorReporterTest;
use selectors::parser::*;
use std::borrow::ToOwned;
use std::sync::Arc;
@ -10,7 +11,6 @@ use string_cache::Atom;
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, DeclaredValue, longhands};
use style::stylesheets::{CSSRule, StyleRule, Origin, Stylesheet};
#[test]
fn test_parse_stylesheet() {
let css = r"
@ -21,7 +21,7 @@ fn test_parse_stylesheet() {
#d1 > .ok { background: blue; }
";
let url = url!("about::test");
let stylesheet = Stylesheet::from_str(css, url, Origin::UserAgent);
let stylesheet = Stylesheet::from_str(css, url, Origin::UserAgent, Box::new(CSSErrorReporterTest));
assert_eq!(stylesheet, Stylesheet {
origin: Origin::UserAgent,
media: None,