mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Defined new trait ParseErrorReporter and added error_reporter member to ParserContext
This commit is contained in:
parent
8efc954531
commit
996e9e06b2
24 changed files with 194 additions and 69 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue