No bug - Fix or remove some unit tests that are not building.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 23 Jun 2018 19:57:51 +0200
changeset 423451 508b5414f8a2ed7495ca0db01d3907f0035de1c5
parent 423450 12df3836b33bb7e31a81fd1919872274f1567639
child 423452 54e3d69a23f7b347d813ce0f8c6ed515db350221
push id34181
push userbtara@mozilla.com
push dateSun, 24 Jun 2018 09:37:59 +0000
treeherdermozilla-central@d69b7fc884fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug - Fix or remove some unit tests that are not building. Unit tests removed have WPT equivalents. MozReview-Commit-ID: H3EyQVMicSG
servo/tests/unit/style/media_queries.rs
servo/tests/unit/style/parsing/length.rs
servo/tests/unit/style/parsing/mod.rs
servo/tests/unit/style/parsing/value.rs
servo/tests/unit/style/properties/background.rs
servo/tests/unit/style/properties/mod.rs
servo/tests/unit/style/properties/serialization.rs
servo/tests/unit/style/rule_tree/bench.rs
servo/tests/unit/style/stylesheets.rs
servo/tests/unit/style/viewport.rs
--- a/servo/tests/unit/style/media_queries.rs
+++ b/servo/tests/unit/style/media_queries.rs
@@ -1,48 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-use cssparser::SourceLocation;
 use euclid::TypedScale;
 use euclid::TypedSize2D;
 use servo_arc::Arc;
 use servo_url::ServoUrl;
 use std::borrow::ToOwned;
 use style::Atom;
 use style::context::QuirksMode;
-use style::error_reporting::{ParseErrorReporter, ContextualParseError};
 use style::media_queries::*;
 use style::servo::media_queries::*;
 use style::shared_lock::SharedRwLock;
 use style::stylesheets::{AllRules, Stylesheet, StylesheetInDocument, Origin, CssRule};
 use style::values::{CustomIdent, specified};
 use style_traits::ToCss;
 
-pub struct CSSErrorReporterTest;
-
-impl ParseErrorReporter for CSSErrorReporterTest {
-    fn report_error(&self,
-                    _url: &ServoUrl,
-                    _location: SourceLocation,
-                    _error: ContextualParseError) {
-    }
-}
-
 fn test_media_rule<F>(css: &str, callback: F)
-    where F: Fn(&MediaList, &str),
+where
+    F: Fn(&MediaList, &str),
 {
     let url = ServoUrl::parse("http://localhost").unwrap();
     let css_str = css.to_owned();
     let lock = SharedRwLock::new();
     let media_list = Arc::new(lock.wrap(MediaList::empty()));
     let stylesheet = Stylesheet::from_str(
         css, url, Origin::Author, media_list, lock,
-        None, &CSSErrorReporterTest, QuirksMode::NoQuirks, 0);
+        None, None, QuirksMode::NoQuirks, 0);
     let dummy = Device::new(MediaType::screen(), TypedSize2D::new(200.0, 100.0), TypedScale::new(1.0));
     let mut rule_count = 0;
     let guard = stylesheet.shared_lock.read();
     for rule in stylesheet.iter_rules::<AllRules>(&dummy, &guard) {
         if let CssRule::Media(ref lock) = *rule {
             rule_count += 1;
             callback(&lock.read_with(&guard).media_queries.read_with(&guard), css);
         }
@@ -51,17 +40,17 @@ fn test_media_rule<F>(css: &str, callbac
 }
 
 fn media_query_test(device: &Device, css: &str, expected_rule_count: usize) {
     let url = ServoUrl::parse("http://localhost").unwrap();
     let lock = SharedRwLock::new();
     let media_list = Arc::new(lock.wrap(MediaList::empty()));
     let ss = Stylesheet::from_str(
         css, url, Origin::Author, media_list, lock,
-        None, &CSSErrorReporterTest, QuirksMode::NoQuirks, 0);
+        None, None, QuirksMode::NoQuirks, 0);
     let mut rule_count = 0;
     ss.effective_style_rules(device, &ss.shared_lock.read(), |_| rule_count += 1);
     assert!(rule_count == expected_rule_count, css.to_owned());
 }
 
 #[test]
 fn test_mq_empty() {
     test_media_rule("@media { }", |list, css| {
deleted file mode 100644
--- a/servo/tests/unit/style/parsing/length.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use cssparser::{Parser, ParserInput};
-use parsing::parse;
-use style::context::QuirksMode;
-use style::parser::{Parse, ParserContext};
-use style::stylesheets::{CssRuleType, Origin};
-use style::values::specified::length::{AbsoluteLength, Length, NoCalcLength};
-use style_traits::{ParsingMode, ToCss};
-
-#[test]
-fn test_calc() {
-    assert!(parse(Length::parse, "calc(1px+ 2px)").is_err());
-    assert!(parse(Length::parse, "calc(calc(1px) + calc(1px + 4px))").is_ok());
-    assert!(parse(Length::parse, "calc( 1px + 2px )").is_ok());
-    assert!(parse(Length::parse, "calc(1px + 2px )").is_ok());
-    assert!(parse(Length::parse, "calc( 1px + 2px)").is_ok());
-    assert!(parse(Length::parse, "calc( 1px + 2px / ( 1 + 2 - 1))").is_ok());
-}
-
-#[test]
-fn test_length_literals() {
-    assert_roundtrip_with_context!(Length::parse, "0.33px", "0.33px");
-    assert_roundtrip_with_context!(Length::parse, "0.33in", "0.33in");
-    assert_roundtrip_with_context!(Length::parse, "0.33cm", "0.33cm");
-    assert_roundtrip_with_context!(Length::parse, "0.33mm", "0.33mm");
-    assert_roundtrip_with_context!(Length::parse, "0.33q", "0.33q");
-    assert_roundtrip_with_context!(Length::parse, "0.33pt", "0.33pt");
-    assert_roundtrip_with_context!(Length::parse, "0.33pc", "0.33pc");
-}
-
-#[test]
-fn test_parsing_modes() {
-    // In default length mode, non-zero lengths must have a unit.
-    assert!(parse(Length::parse, "1").is_err());
-
-    // In SVG length mode, non-zero lengths are assumed to be px.
-    let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
-    let context = ParserContext::new(Origin::Author, &url,
-                                     Some(CssRuleType::Style), ParsingMode::ALLOW_UNITLESS_LENGTH,
-                                     QuirksMode::NoQuirks);
-    let mut input = ParserInput::new("1");
-    let mut parser = Parser::new(&mut input);
-    let result = Length::parse(&context, &mut parser);
-    assert!(result.is_ok());
-    assert_eq!(result.unwrap(), Length::NoCalc(NoCalcLength::Absolute(AbsoluteLength::Px(1.))));
-}
--- a/servo/tests/unit/style/parsing/mod.rs
+++ b/servo/tests/unit/style/parsing/mod.rs
@@ -16,17 +16,17 @@ where F: for<'t> Fn(&ParserContext, &mut
     parse_input(f, &mut input)
 }
 
 fn parse_input<'i: 't, 't, T, F>(f: F, input: &'t mut ParserInput<'i>) -> Result<T, ParseError<'i>>
 where F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>> {
     let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
     let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Style),
                                      ParsingMode::DEFAULT,
-                                     QuirksMode::NoQuirks);
+                                     QuirksMode::NoQuirks, None);
     let mut parser = Parser::new(input);
     f(&context, &mut parser)
 }
 
 fn parse_entirely<T, F>(f: F, s: &'static str) -> Result<T, ParseError<'static>>
 where F: for<'t> Fn(&ParserContext, &mut Parser<'static, 't>) -> Result<T, ParseError<'static>> {
     let mut input = ParserInput::new(s);
     parse_entirely_input(f, &mut input)
@@ -106,17 +106,15 @@ macro_rules! parse_longhand {
 mod animation;
 mod background;
 mod border;
 mod box_;
 mod column;
 mod effects;
 mod image;
 mod inherited_text;
-mod length;
 mod outline;
 mod position;
 mod selectors;
 mod supports;
 mod text_overflow;
 mod transition_duration;
 mod transition_timing_function;
-mod value;
deleted file mode 100644
--- a/servo/tests/unit/style/parsing/value.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use cssparser::{Parser, ParserInput};
-use style::context::QuirksMode;
-use style::parser::ParserContext;
-use style::stylesheets::{CssRuleType, Origin};
-use style::values::specified::Number;
-use style_traits::ParsingMode;
-
-#[test]
-fn test_parsing_allo_all_numeric_values() {
-    // In SVG length mode, non-zero lengths are assumed to be px.
-    let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
-    let context = ParserContext::new(Origin::Author, &url,
-                                     Some(CssRuleType::Style), ParsingMode::ALLOW_ALL_NUMERIC_VALUES,
-                                     QuirksMode::NoQuirks);
-    let mut input = ParserInput::new("-1");
-    let mut parser = Parser::new(&mut input);
-    let result = Number::parse_non_negative(&context, &mut parser);
-    assert!(result.is_ok());
-    assert_eq!(result.unwrap(), Number::new(-1.));
-}
-
deleted file mode 100644
--- a/servo/tests/unit/style/properties/background.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use properties::parse;
-use style::properties::longhands::background_size;
-
-#[test]
-fn background_size_should_reject_negative_values() {
-    assert!(parse(|c, _, i| background_size::parse(c, i), "-40% -40%").is_err());
-}
--- a/servo/tests/unit/style/properties/mod.rs
+++ b/servo/tests/unit/style/properties/mod.rs
@@ -1,63 +1,60 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use cssparser::{Parser, ParserInput};
-use media_queries::CSSErrorReporterTest;
 use style::context::QuirksMode;
-use style::parser::{ParserContext, ParserErrorContext};
+use style::parser::ParserContext;
 use style::stylesheets::{CssRuleType, Origin};
 use style_traits::{ParsingMode, ParseError};
 
 fn parse<T, F>(f: F, s: &'static str) -> Result<T, ParseError<'static>>
-    where F: for<'t> Fn(&ParserContext,
-                        &ParserErrorContext<CSSErrorReporterTest>,
-                        &mut Parser<'static, 't>) -> Result<T, ParseError<'static>>
+where
+    F: for<'t> Fn(
+        &ParserContext,
+        &mut Parser<'static, 't>,
+    ) -> Result<T, ParseError<'static>>
 {
     let mut input = ParserInput::new(s);
     parse_input(f, &mut input)
 }
 
 fn parse_input<'i: 't, 't, T, F>(f: F, input: &'t mut ParserInput<'i>) -> Result<T, ParseError<'i>>
-    where F: Fn(&ParserContext,
-                &ParserErrorContext<CSSErrorReporterTest>,
-                &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>
+where
+    F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>,
 {
     let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
     let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Style),
                                      ParsingMode::DEFAULT,
-                                     QuirksMode::NoQuirks);
-    let reporter = CSSErrorReporterTest;
-    let error_context = ParserErrorContext { error_reporter: &reporter };
+                                     QuirksMode::NoQuirks, None);
     let mut parser = Parser::new(input);
-    f(&context, &error_context, &mut parser)
+    f(&context, &mut parser)
 }
 
 macro_rules! assert_roundtrip_with_context {
     ($fun:expr, $string:expr) => {
         assert_roundtrip_with_context!($fun, $string, $string);
     };
     ($fun:expr, $input:expr, $output:expr) => {{
-        let serialized = parse(|context, _, i| {
+        let serialized = parse(|context, i| {
             let parsed = $fun(context, i)
                          .expect(&format!("Failed to parse {}", $input));
             let serialized = ToCss::to_css_string(&parsed);
             assert_eq!(serialized, $output);
             Ok(serialized)
         }, $input).unwrap();
 
         let mut input = ::cssparser::ParserInput::new(&serialized);
-        let unwrapped = parse_input(|context, _, i| {
+        let unwrapped = parse_input(|context, i| {
             let re_parsed = $fun(context, i)
                             .expect(&format!("Failed to parse serialization {}", $input));
             let re_serialized = ToCss::to_css_string(&re_parsed);
             assert_eq!(serialized, re_serialized);
             Ok(())
         }, &mut input).unwrap();
         unwrapped
     }}
 }
 
-mod background;
 mod scaffolding;
 mod serialization;
--- a/servo/tests/unit/style/properties/serialization.rs
+++ b/servo/tests/unit/style/properties/serialization.rs
@@ -479,17 +479,17 @@ mod shorthand_serialization {
             // serialization of 'border' shorthand, we need to set 'border-image' as well.
             let block_text = "\
                 border-top: 4px solid; \
                 border-right: 4px solid; \
                 border-bottom: 4px solid; \
                 border-left: 4px solid; \
                 border-image: none;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "border: 4px solid;");
         }
     }
 
     mod list_style {
@@ -531,17 +531,17 @@ mod shorthand_serialization {
                 background-repeat: repeat-x; \
                 background-attachment: scroll; \
                 background-size: 70px 50px; \
                 background-position-x: 7px; \
                 background-position-y: bottom 4px; \
                 background-origin: border-box; \
                 background-clip: padding-box;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(
                 serialization,
                 "background: rgb(255, 0, 0) url(\"http://servo/test.png\") repeat-x \
                 scroll left 7px bottom 4px / 70px 50px border-box padding-box;"
             );
@@ -555,17 +555,17 @@ mod shorthand_serialization {
                 background-repeat: repeat-x; \
                 background-attachment: scroll; \
                 background-size: 70px 50px; \
                 background-position-x: 7px; \
                 background-position-y: 4px; \
                 background-origin: padding-box; \
                 background-clip: padding-box;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(
                 serialization,
                 "background: rgb(255, 0, 0) url(\"http://servo/test.png\") repeat-x \
                 scroll 7px 4px / 70px 50px padding-box;"
             );
@@ -579,17 +579,17 @@ mod shorthand_serialization {
                 background-repeat: repeat-x, repeat-y; \
                 background-attachment: scroll, scroll; \
                 background-size: 70px 50px, 20px 30px; \
                 background-position-x: 7px, 70px; \
                 background-position-y: 4px, 40px; \
                 background-origin: border-box, padding-box; \
                 background-clip: padding-box, padding-box;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(
                 serialization, "background: \
                 url(\"http://servo/test.png\") repeat-x scroll 7px 4px / 70px 50px border-box padding-box, \
                 rgb(0, 0, 255) none repeat-y scroll 70px 40px / 20px 30px padding-box;"
             );
@@ -610,40 +610,40 @@ mod shorthand_serialization {
                 background-image: url(\"http://servo/test.png\"), none; \
                 background-repeat: repeat-x, repeat-y; \
                 background-attachment: scroll, scroll; \
                 background-size: 70px 50px, 20px 30px; \
                 background-position: 7px 4px, 5px 6px; \
                 background-origin: border-box; \
                 background-clip: padding-box, padding-box;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, block_text);
         }
 
         #[test]
         fn background_position_should_be_a_valid_form_its_longhands() {
             // If there is any longhand consisted of both keyword and position,
             // the shorthand result should be the 4-value format.
             let block_text = "\
                 background-position-x: 30px;\
                 background-position-y: bottom 20px;";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
             let serialization = block.to_css_string();
             assert_eq!(serialization, "background-position: left 30px bottom 20px;");
 
             // If there is no longhand consisted of both keyword and position,
             // the shorthand result should be the 2-value format.
             let block_text = "\
                 background-position-x: center;\
                 background-position-y: 20px;";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
             let serialization = block.to_css_string();
             assert_eq!(serialization, "background-position: center 20px;");
         }
     }
 
     mod transform {
         pub use super::*;
         use style::values::generics::transform::TransformOperation;
@@ -719,17 +719,17 @@ mod shorthand_serialization {
                 animation-duration: 1s;\
                 animation-timing-function: ease-in;\
                 animation-delay: 0s;\
                 animation-direction: normal;\
                 animation-fill-mode: forwards;\
                 animation-iteration-count: infinite;\
                 animation-play-state: paused;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "animation: 1s ease-in 0s infinite normal forwards paused bounce;")
         }
 
         #[test]
         fn serialize_multiple_animations() {
@@ -738,17 +738,17 @@ mod shorthand_serialization {
                 animation-duration: 1s, 0.2s;\
                 animation-timing-function: ease-in, linear;\
                 animation-delay: 0s, 1s;\
                 animation-direction: normal, reverse;\
                 animation-fill-mode: forwards, backwards;\
                 animation-iteration-count: infinite, 2;\
                 animation-play-state: paused, running;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization,
                        "animation: 1s ease-in 0s infinite normal forwards paused bounce, \
                                    0.2s linear 1s 2 reverse backwards running roll;");
         }
 
@@ -764,34 +764,34 @@ mod shorthand_serialization {
                 animation-duration: 1s, 0.2s; \
                 animation-timing-function: ease-in, linear; \
                 animation-delay: 0s, 1s, 0.5s; \
                 animation-direction: normal; \
                 animation-fill-mode: forwards, backwards; \
                 animation-iteration-count: infinite, 2; \
                 animation-play-state: paused, running;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, block_text);
         }
 
         #[test]
         fn serialize_multiple_without_all_properties_returns_longhand() {
             // timing function and direction are missing, so no shorthand is returned.
             let block_text = "animation-name: bounce, roll; \
                               animation-duration: 1s, 0.2s; \
                               animation-delay: 0s, 1s; \
                               animation-fill-mode: forwards, backwards; \
                               animation-iteration-count: infinite, 2; \
                               animation-play-state: paused, running;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, block_text);
         }
     }
 
     mod transition {
@@ -799,31 +799,31 @@ mod shorthand_serialization {
 
         #[test]
         fn transition_should_serialize_all_available_properties() {
             let block_text = "transition-property: margin-left; \
                               transition-duration: 3s; \
                               transition-delay: 4s; \
                               transition-timing-function: cubic-bezier(0.2, 5, 0.5, 2);";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "transition: margin-left 3s cubic-bezier(0.2, 5, 0.5, 2) 4s;");
         }
 
         #[test]
         fn serialize_multiple_transitions() {
             let block_text = "transition-property: margin-left, width; \
                               transition-duration: 3s, 2s; \
                               transition-delay: 4s, 5s; \
                               transition-timing-function: cubic-bezier(0.2, 5, 0.5, 2), ease;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "transition: \
                 margin-left 3s cubic-bezier(0.2, 5, 0.5, 2) 4s, \
                 width 2s ease 5s;");
         }
 
@@ -835,65 +835,65 @@ mod shorthand_serialization {
             // lists have the same length (this affects background, transition and animation).
             // https://github.com/servo/servo/issues/15398 )
             // The duration below has 1 extra value.
             let block_text = "transition-property: margin-left, width; \
                               transition-duration: 3s, 2s, 4s; \
                               transition-delay: 4s, 5s; \
                               transition-timing-function: cubic-bezier(0.2, 5, 0.5, 2), ease;";
 
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, block_text);
         }
 
         #[test]
         fn transition_should_serialize_acceptable_step_timing_function() {
             let block_text = "transition-property: margin-left; \
                               transition-duration: 3s; \
                               transition-delay: 4s; \
                               transition-timing-function: steps(2, start);";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "transition: margin-left 3s steps(2, start) 4s;");
         }
 
         #[test]
         fn transition_should_serialize_acceptable_frames_timing_function() {
             let block_text = "transition-property: margin-left; \
                               transition-duration: 3s; \
                               transition-delay: 4s; \
                               transition-timing-function: frames(2);";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
 
             assert_eq!(serialization, "transition: margin-left 3s frames(2) 4s;");
         }
     }
 
     mod keywords {
         pub use super::*;
         #[test]
         fn css_wide_keywords_should_be_parsed() {
             let block_text = "--a:inherit;";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
             assert_eq!(serialization, "--a: inherit;");
         }
 
         #[test]
         fn non_keyword_custom_property_should_be_unparsed() {
             let block_text = "--main-color: #06c;";
-            let block = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), block_text).unwrap();
+            let block = parse(|c, i| Ok(parse_property_declaration_list(c, i)), block_text).unwrap();
 
             let serialization = block.to_css_string();
             assert_eq!(serialization, block_text);
         }
     }
 
     mod effects {
         pub use super::*;
@@ -913,14 +913,14 @@ mod shorthand_serialization {
                     blur: Some(NonNegativeLength::from_px(3f32)),
                 },
                 spread: Some(Length::from_px(4f32)),
                 inset: false,
             };
             let shadow_decl = BoxShadowList(vec![shadow_val]);
             properties.push(PropertyDeclaration::BoxShadow(shadow_decl));
             let shadow_css = "box-shadow: 1px 2px 3px 4px;";
-            let shadow = parse(|c, e, i| Ok(parse_property_declaration_list(c, e, i)), shadow_css).unwrap();
+            let shadow = parse(|c, i| Ok(parse_property_declaration_list(c, i)), shadow_css).unwrap();
 
             assert_eq!(shadow.to_css_string(), shadow_css);
         }
     }
 }
--- a/servo/tests/unit/style/rule_tree/bench.rs
+++ b/servo/tests/unit/style/rule_tree/bench.rs
@@ -50,17 +50,17 @@ fn parse_rules(css: &str) -> Vec<(StyleS
     let media = Arc::new(lock.wrap(MediaList::empty()));
 
     let s = Stylesheet::from_str(css,
                                  ServoUrl::parse("http://localhost").unwrap(),
                                  Origin::Author,
                                  media,
                                  lock,
                                  None,
-                                 &ErrorringErrorReporter,
+                                 Some(&ErrorringErrorReporter),
                                  QuirksMode::NoQuirks,
                                  0);
     let guard = s.shared_lock.read();
     let rules = s.contents.rules.read_with(&guard);
     rules.0.iter().filter_map(|rule| {
         match *rule {
             CssRule::Style(ref style_rule) => Some((
                 StyleSource::from_rule(style_rule.clone()),
--- a/servo/tests/unit/style/stylesheets.rs
+++ b/servo/tests/unit/style/stylesheets.rs
@@ -1,15 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use cssparser::{self, SourceLocation};
 use html5ever::{Namespace as NsAtom};
-use media_queries::CSSErrorReporterTest;
 use parking_lot::RwLock;
 use selectors::attr::*;
 use selectors::parser::*;
 use servo_arc::Arc;
 use servo_atoms::Atom;
 use servo_config::prefs::{PREFS, PrefValue};
 use servo_url::ServoUrl;
 use std::borrow::ToOwned;
@@ -66,17 +65,17 @@ fn test_parse_stylesheet() {
                 animation-name: 'foo'; /* animation properties not allowed here */
                 animation-timing-function: ease; /* … except animation-timing-function */
             }
         }";
     let url = ServoUrl::parse("about::test").unwrap();
     let lock = SharedRwLock::new();
     let media = Arc::new(lock.wrap(MediaList::empty()));
     let stylesheet = Stylesheet::from_str(css, url.clone(), Origin::UserAgent, media, lock,
-                                          None, &CSSErrorReporterTest, QuirksMode::NoQuirks, 0);
+                                          None, None, QuirksMode::NoQuirks, 0);
     let mut namespaces = Namespaces::default();
     namespaces.default = Some(ns!(html));
     let expected = Stylesheet {
         contents: StylesheetContents {
             origin: Origin::UserAgent,
             namespaces: RwLock::new(namespaces),
             url_data: RwLock::new(url),
             quirks_mode: QuirksMode::NoQuirks,
@@ -340,17 +339,17 @@ fn test_report_error_stylesheet() {
     @viewport { width: 320px invalid auto; }
     ";
     let url = ServoUrl::parse("about::test").unwrap();
     let error_reporter = TestingErrorReporter::new();
 
     let lock = SharedRwLock::new();
     let media = Arc::new(lock.wrap(MediaList::empty()));
     Stylesheet::from_str(css, url.clone(), Origin::UserAgent, media, lock,
-                         None, &error_reporter, QuirksMode::NoQuirks, 5);
+                         None, Some(&error_reporter), QuirksMode::NoQuirks, 5);
 
     error_reporter.assert_messages_contain(&[
         (8, 18, "Unsupported property declaration: 'display: invalid;'"),
         (9, 27, "Unsupported property declaration: 'background-image:"),  // FIXME: column should be around 56
         (10, 17, "Unsupported property declaration: 'invalid: true;'"),
         (12, 28, "Invalid media rule"),
         (13, 30, "Unsupported @font-face descriptor declaration"),
 
@@ -382,17 +381,17 @@ fn test_no_report_unrecognized_vendor_pr
     }
     ";
     let url = ServoUrl::parse("about::test").unwrap();
     let error_reporter = TestingErrorReporter::new();
 
     let lock = SharedRwLock::new();
     let media = Arc::new(lock.wrap(MediaList::empty()));
     Stylesheet::from_str(css, url, Origin::UserAgent, media, lock,
-                         None, &error_reporter, QuirksMode::NoQuirks, 0);
+                         None, Some(&error_reporter), QuirksMode::NoQuirks, 0);
 
     error_reporter.assert_messages_contain(&[
         (4, 31, "Unsupported property declaration: '-moz-background-color: red;'"),
     ]);
 }
 
 #[test]
 fn test_source_map_url() {
@@ -401,17 +400,17 @@ fn test_source_map_url() {
         ("/*# sourceMappingURL=something */", Some("something".to_string())),
     ];
 
     for test in tests {
         let url = ServoUrl::parse("about::test").unwrap();
         let lock = SharedRwLock::new();
         let media = Arc::new(lock.wrap(MediaList::empty()));
         let stylesheet = Stylesheet::from_str(test.0, url.clone(), Origin::UserAgent, media, lock,
-                                              None, &CSSErrorReporterTest, QuirksMode::NoQuirks,
+                                              None, None, QuirksMode::NoQuirks,
                                               0);
         let url_opt = stylesheet.contents.source_map_url.read();
         assert_eq!(*url_opt, test.1);
     }
 }
 
 #[test]
 fn test_source_url() {
@@ -420,14 +419,14 @@ fn test_source_url() {
         ("/*# sourceURL=something */", Some("something".to_string())),
     ];
 
     for test in tests {
         let url = ServoUrl::parse("about::test").unwrap();
         let lock = SharedRwLock::new();
         let media = Arc::new(lock.wrap(MediaList::empty()));
         let stylesheet = Stylesheet::from_str(test.0, url.clone(), Origin::UserAgent, media, lock,
-                                              None, &CSSErrorReporterTest, QuirksMode::NoQuirks,
+                                              None, None, QuirksMode::NoQuirks,
                                               0);
         let url_opt = stylesheet.contents.source_url.read();
         assert_eq!(*url_opt, test.1);
     }
 }
--- a/servo/tests/unit/style/viewport.rs
+++ b/servo/tests/unit/style/viewport.rs
@@ -1,57 +1,56 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use cssparser::{Parser, ParserInput};
 use euclid::TypedScale;
 use euclid::TypedSize2D;
-use media_queries::CSSErrorReporterTest;
 use servo_arc::Arc;
 use servo_config::prefs::{PREFS, PrefValue};
 use servo_url::ServoUrl;
 use style::context::QuirksMode;
 use style::media_queries::{Device, MediaList, MediaType};
-use style::parser::{ParserContext, ParserErrorContext};
+use style::parser::ParserContext;
 use style::shared_lock::{SharedRwLock, StylesheetGuards};
 use style::stylesheets::{CssRuleType, Stylesheet, StylesheetInDocument, Origin};
 use style::stylesheets::viewport_rule::*;
 use style::values::specified::LengthOrPercentageOrAuto::{self, Auto};
 use style::values::specified::NoCalcLength::{self, ViewportPercentage};
 use style::values::specified::ViewportPercentageLength::Vw;
 use style_traits::{ParsingMode, PinchZoomFactor};
 use style_traits::viewport::*;
 
 macro_rules! stylesheet {
-    ($css:expr, $origin:ident, $error_reporter:expr) => {
-        stylesheet!($css, $origin, $error_reporter, SharedRwLock::new())
+    ($css:expr, $origin:ident) => {
+        stylesheet!($css, $origin, SharedRwLock::new())
     };
-    ($css:expr, $origin:ident, $error_reporter:expr, $shared_lock:expr) => {
+    ($css:expr, $origin:ident, $shared_lock:expr) => {
         Arc::new(Stylesheet::from_str(
             $css,
             ServoUrl::parse("http://localhost").unwrap(),
             Origin::$origin,
             Arc::new($shared_lock.wrap(MediaList::empty())),
             $shared_lock,
             None,
-            &$error_reporter,
+            None,
             QuirksMode::NoQuirks,
             0
         ))
     }
 }
 
 fn test_viewport_rule<F>(css: &str,
                          device: &Device,
                          callback: F)
     where F: Fn(&Vec<ViewportDescriptorDeclaration>, &str)
 {
     PREFS.set("layout.viewport.enabled", PrefValue::Boolean(true));
-    let stylesheet = stylesheet!(css, Author, CSSErrorReporterTest);
+    let stylesheet = stylesheet!(css, Author);
     let mut rule_count = 0;
     stylesheet.effective_viewport_rules(&device, &stylesheet.shared_lock.read(), |rule| {
         rule_count += 1;
         callback(&rule.declarations, css);
     });
     assert!(rule_count > 0);
 }
 
@@ -254,44 +253,44 @@ fn cascading_within_viewport_rule() {
         assert_decl_eq!(&declarations[1], Author, MaxWidth: ViewportLength::Specified(Auto), !important);
     });
 }
 
 #[test]
 fn multiple_stylesheets_cascading() {
     PREFS.set("layout.viewport.enabled", PrefValue::Boolean(true));
     let device = Device::new(MediaType::screen(), TypedSize2D::new(800., 600.), TypedScale::new(1.0));
-    let error_reporter = CSSErrorReporterTest;
     let shared_lock = SharedRwLock::new();
     let stylesheets = vec![
         stylesheet!("@viewport { min-width: 100px; min-height: 100px; zoom: 1; }",
-                    UserAgent, error_reporter, shared_lock.clone()),
+                    UserAgent,
+                    shared_lock.clone()),
         stylesheet!("@viewport { min-width: 200px; min-height: 200px; }",
-                    User, error_reporter, shared_lock.clone()),
+                    User, shared_lock.clone()),
         stylesheet!("@viewport { min-width: 300px; }",
-                    Author, error_reporter, shared_lock.clone())
+                    Author, shared_lock.clone())
     ];
 
     let declarations = Cascade::from_stylesheets(
         stylesheets.iter().map(|s| (&**s, Origin::Author)),
         &StylesheetGuards::same(&shared_lock.read()),
         &device,
     ).finish();
     assert_decl_len!(declarations == 3);
     assert_decl_eq!(&declarations[0], UserAgent, Zoom: Zoom::Number(1.));
     assert_decl_eq!(&declarations[1], User, MinHeight: viewport_length!(200., px));
     assert_decl_eq!(&declarations[2], Author, MinWidth: viewport_length!(300., px));
 
     let stylesheets = vec![
         stylesheet!("@viewport { min-width: 100px !important; }",
-                    UserAgent, error_reporter, shared_lock.clone()),
+                    UserAgent, shared_lock.clone()),
         stylesheet!("@viewport { min-width: 200px !important; min-height: 200px !important; }",
-                    User, error_reporter, shared_lock.clone()),
+                    User, shared_lock.clone()),
         stylesheet!("@viewport { min-width: 300px !important; min-height: 300px !important; zoom: 3 !important; }",
-                    Author, error_reporter, shared_lock.clone())
+                    Author, shared_lock.clone())
     ];
     let declarations = Cascade::from_stylesheets(
         stylesheets.iter().map(|s| (&**s, Origin::Author)),
         &StylesheetGuards::same(&shared_lock.read()),
         &device,
     ).finish();
     assert_decl_len!(declarations == 3);
     assert_decl_eq!(&declarations[0], UserAgent, MinWidth: viewport_length!(100., px), !important);
@@ -299,22 +298,21 @@ fn multiple_stylesheets_cascading() {
     assert_decl_eq!(&declarations[2], Author, Zoom: Zoom::Number(3.), !important);
 }
 
 #[test]
 fn constrain_viewport() {
     let url = ServoUrl::parse("http://localhost").unwrap();
     let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Viewport),
                                      ParsingMode::DEFAULT,
-                                     QuirksMode::NoQuirks);
-    let error_context = ParserErrorContext { error_reporter: &CSSErrorReporterTest };
+                                     QuirksMode::NoQuirks, None);
 
     macro_rules! from_css {
         ($css:expr) => {
-            &ViewportRule::parse(&context, &error_context, &mut Parser::new(&mut $css)).unwrap()
+            &ViewportRule::parse(&context, &mut Parser::new(&mut $css)).unwrap()
         }
     }
 
     let initial_viewport = TypedSize2D::new(800., 600.);
     let device = Device::new(MediaType::screen(), initial_viewport, TypedScale::new(1.0));
     let mut input = ParserInput::new("");
     assert_eq!(ViewportConstraints::maybe_new(&device, from_css!(input), QuirksMode::NoQuirks), None);