diff --git a/tests/unit/style/parsing/basic_shape.rs b/tests/unit/style/parsing/basic_shape.rs index da829e7c29d..6363e7772ca 100644 --- a/tests/unit/style/parsing/basic_shape.rs +++ b/tests/unit/style/parsing/basic_shape.rs @@ -5,6 +5,7 @@ use parsing::parse; use style::parser::Parse; use style::values::specified::basic_shape::*; +use style_traits::ToCss; // Ensure that basic-shape sub-functions parse as both basic shapes // and their individual components @@ -21,14 +22,14 @@ macro_rules! assert_border_radius_values { let input = parse(BorderRadius::parse, $input) .expect(&format!("Failed parsing {} as border radius", $input)); - assert_eq!(::cssparser::ToCss::to_css_string(&input.top_left.0.width), $tlw); - assert_eq!(::cssparser::ToCss::to_css_string(&input.top_right.0.width), $trw); - assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_right.0.width), $brw); - assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_left.0.width), $blw); - assert_eq!(::cssparser::ToCss::to_css_string(&input.top_left.0.height), $tlh); - assert_eq!(::cssparser::ToCss::to_css_string(&input.top_right.0.height), $trh); - assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_right.0.height), $brh); - assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_left.0.height), $blh); + assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.width), $tlw); + assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.width), $trw); + assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.width), $brw); + assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.width), $blw); + assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.height), $tlh); + assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.height), $trh); + assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.height), $brh); + assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.height), $blh); } } diff --git a/tests/unit/style/parsing/font.rs b/tests/unit/style/parsing/font.rs index 1873314dc89..178a43f6e9b 100644 --- a/tests/unit/style/parsing/font.rs +++ b/tests/unit/style/parsing/font.rs @@ -9,6 +9,7 @@ use style::properties::longhands::font_feature_settings; use style::properties::longhands::font_feature_settings::computed_value; use style::properties::longhands::font_feature_settings::computed_value::FeatureTagValue; use style::stylesheets::Origin; +use style_traits::ToCss; use url::Url; #[test] @@ -100,7 +101,7 @@ fn font_language_override_should_parse_properly() { #[test] #[should_panic] fn font_language_override_should_fail_on_empty_str() { - use style::properties::longhands::font_language_override::{self, SpecifiedValue}; + use style::properties::longhands::font_language_override; parse_longhand!(font_language_override, ""); } diff --git a/tests/unit/style/parsing/image.rs b/tests/unit/style/parsing/image.rs index 23679196fc5..d6d8651381e 100644 --- a/tests/unit/style/parsing/image.rs +++ b/tests/unit/style/parsing/image.rs @@ -7,6 +7,7 @@ use media_queries::CSSErrorReporterTest; use style::parser::ParserContext; use style::stylesheets::Origin; use style::values::specified::image::*; +use style_traits::ToCss; use url::Url; #[test] diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index 80c6cfff68d..f2fed25b7fd 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -21,12 +21,12 @@ macro_rules! assert_roundtrip { ($fun:expr, $input:expr, $output:expr) => { let parsed = $crate::parsing::parse($fun, $input) .expect(&format!("Failed to parse {}", $input)); - let serialized = ::cssparser::ToCss::to_css_string(&parsed); + let serialized = ToCss::to_css_string(&parsed); assert_eq!(serialized, $output); let re_parsed = $crate::parsing::parse($fun, &serialized) .expect(&format!("Failed to parse serialization {}", $input)); - let re_serialized = ::cssparser::ToCss::to_css_string(&re_parsed); + let re_serialized = ToCss::to_css_string(&re_parsed); assert_eq!(serialized, re_serialized); } } @@ -41,13 +41,13 @@ macro_rules! assert_roundtrip_with_context { let mut parser = Parser::new($input); let parsed = $fun(&context, &mut parser) .expect(&format!("Failed to parse {}", $input)); - let serialized = ::cssparser::ToCss::to_css_string(&parsed); + let serialized = ToCss::to_css_string(&parsed); assert_eq!(serialized, $output); let mut parser = Parser::new(&serialized); let re_parsed = $fun(&context, &mut parser) .expect(&format!("Failed to parse {}", $input)); - let re_serialized = ::cssparser::ToCss::to_css_string(&re_parsed); + let re_serialized = ToCss::to_css_string(&re_parsed); assert_eq!(serialized, re_serialized); } } diff --git a/tests/unit/style/parsing/position.rs b/tests/unit/style/parsing/position.rs index f82a09da0d3..17a9e92679d 100644 --- a/tests/unit/style/parsing/position.rs +++ b/tests/unit/style/parsing/position.rs @@ -4,6 +4,7 @@ use parsing::parse; use style::values::specified::position::*; +use style_traits::ToCss; #[test] fn test_position() { diff --git a/tests/unit/style/parsing/selectors.rs b/tests/unit/style/parsing/selectors.rs index abd1a3b5e9a..f7cb562c274 100644 --- a/tests/unit/style/parsing/selectors.rs +++ b/tests/unit/style/parsing/selectors.rs @@ -2,7 +2,7 @@ * 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; +use cssparser::{Parser, ToCss}; use selectors::parser::{Selector, ParserContext, parse_selector_list}; use style::selector_impl::TheSelectorImpl; diff --git a/tests/unit/style/properties/serialization.rs b/tests/unit/style/properties/serialization.rs index 20c4d1eba07..3b920059b62 100644 --- a/tests/unit/style/properties/serialization.rs +++ b/tests/unit/style/properties/serialization.rs @@ -2,7 +2,6 @@ * 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/. */ -pub use cssparser::ToCss; pub use std::sync::Arc; pub use style::computed_values::display::T::inline_block; pub use style::properties::{DeclaredValue, PropertyDeclaration, PropertyDeclarationBlock, Importance}; @@ -11,6 +10,7 @@ pub use style::values::specified::{LengthOrPercentage, LengthOrPercentageOrAuto, pub use style::properties::longhands::outline_color::computed_value::T as ComputedColor; pub use style::values::RGBA; pub use style::values::specified::UrlExtraData; +pub use style_traits::ToCss; pub use url::Url; #[test] diff --git a/tests/unit/stylo/lib.rs b/tests/unit/stylo/lib.rs index 8690c17f517..03df4957b9a 100644 --- a/tests/unit/stylo/lib.rs +++ b/tests/unit/stylo/lib.rs @@ -11,6 +11,7 @@ extern crate libc; #[macro_use] extern crate log; extern crate parking_lot; extern crate style; +extern crate style_traits; extern crate url; mod sanity_checks;