diff --git a/components/style/cascade_info.rs b/components/style/cascade_info.rs index 5c7565909db..2fdd047dadf 100644 --- a/components/style/cascade_info.rs +++ b/components/style/cascade_info.rs @@ -8,7 +8,7 @@ use dom::TNode; use properties::{DeclaredValue, PropertyDeclaration}; -use values::HasViewportPercentage; +use style_traits::HasViewportPercentage; /// A structure to collect information about the cascade. /// diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index 071efade790..15435e4743d 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -14,7 +14,7 @@ use std::ascii::AsciiExt; use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::fmt; -use style_traits::ToCss; +use style_traits::{HasViewportPercentage, ToCss}; use stylearc::Arc; /// A custom property name is just an `Atom`. @@ -49,7 +49,7 @@ pub struct SpecifiedValue { references: HashSet, } -impl ::values::HasViewportPercentage for SpecifiedValue { +impl HasViewportPercentage for SpecifiedValue { fn has_viewport_percentage(&self) -> bool { panic!("has_viewport_percentage called before resolving!"); } diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index d57f54c24bc..20da42ab58c 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -82,7 +82,7 @@ use smallvec::SmallVec; use std::fmt; #[allow(unused_imports)] - use values::HasViewportPercentage; + use style_traits::HasViewportPercentage; use style_traits::ToCss; pub mod single_value { diff --git a/components/style/properties/longhand/effects.mako.rs b/components/style/properties/longhand/effects.mako.rs index 730142b76a7..0374ae0dafb 100644 --- a/components/style/properties/longhand/effects.mako.rs +++ b/components/style/properties/longhand/effects.mako.rs @@ -87,8 +87,8 @@ ${helpers.predefined_type("clip", spec="https://drafts.fxtf.org/filters/#propdef-filter"> //pub use self::computed_value::T as SpecifiedValue; use std::fmt; - use style_traits::ToCss; - use values::{CSSFloat, HasViewportPercentage}; + use style_traits::{HasViewportPercentage, ToCss}; + use values::CSSFloat; use values::specified::{Angle, Length}; #[cfg(feature = "gecko")] use values::specified::Shadow; diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 191dca52574..29bd2478524 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -550,8 +550,8 @@ ${helpers.single_keyword_system("font-variant-caps", use properties::longhands::system_font::SystemFont; use properties::style_structs::Font; use std::fmt; - use style_traits::ToCss; - use values::{FONT_MEDIUM_PX, HasViewportPercentage}; + use style_traits::{HasViewportPercentage, ToCss}; + use values::FONT_MEDIUM_PX; use values::specified::{AllowQuirks, FontRelativeLength, LengthOrPercentage}; use values::specified::{NoCalcLength, Percentage}; use values::specified::length::FontBaseSize; diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 47022d30a6a..158bdbf6e78 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -34,10 +34,10 @@ use parser::{PARSING_MODE_DEFAULT, Parse, ParserContext}; use properties::animated_properties::TransitionProperty; #[cfg(feature = "servo")] use servo_config::prefs::PREFS; use shared_lock::StylesheetGuards; -use style_traits::ToCss; +use style_traits::{HasViewportPercentage, ToCss}; use stylesheets::{CssRuleType, Origin, UrlExtraData}; #[cfg(feature = "servo")] use values::Either; -use values::{HasViewportPercentage, computed}; +use values::computed; use cascade_info::CascadeInfo; use rule_tree::StrongRuleNode; use style_adjuster::StyleAdjuster; diff --git a/components/style/values/generics/basic_shape.rs b/components/style/values/generics/basic_shape.rs index d961141dbc9..f75c038b59a 100644 --- a/components/style/values/generics/basic_shape.rs +++ b/components/style/values/generics/basic_shape.rs @@ -11,8 +11,7 @@ use parser::{Parse, ParserContext}; use properties::shorthands::serialize_four_sides; use std::ascii::AsciiExt; use std::fmt; -use style_traits::ToCss; -use values::HasViewportPercentage; +use style_traits::{HasViewportPercentage, ToCss}; use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue}; use values::generics::BorderRadiusSize; use values::specified::url::SpecifiedUrl; diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index 2b42314eb00..034bc0c2859 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -9,8 +9,7 @@ use Atom; use cssparser::serialize_identifier; use std::fmt; -use style_traits::ToCss; -use values::HasViewportPercentage; +use style_traits::{HasViewportPercentage, ToCss}; use values::computed::{Context, ToComputedValue}; use values::specified::url::SpecifiedUrl; diff --git a/components/style/values/generics/mod.rs b/components/style/values/generics/mod.rs index 9ad4668f4da..58445ef39df 100644 --- a/components/style/values/generics/mod.rs +++ b/components/style/values/generics/mod.rs @@ -10,9 +10,8 @@ use cssparser::Parser; use euclid::size::Size2D; use parser::{Parse, ParserContext}; use std::fmt; -use style_traits::ToCss; +use style_traits::{HasViewportPercentage, ToCss}; use super::CustomIdent; -use super::HasViewportPercentage; use super::computed::{Context, ToComputedValue}; pub use self::basic_shape::serialize_radius_values; diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs index 6a6469a1742..bbb6603bb90 100644 --- a/components/style/values/mod.rs +++ b/components/style/values/mod.rs @@ -16,7 +16,6 @@ use std::borrow::Cow; use std::fmt::{self, Debug}; use std::hash; use style_traits::ToCss; -pub use style_traits::HasViewportPercentage; pub mod computed; pub mod generics; diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs index 4db36e998c2..dc6f5cf2f81 100644 --- a/components/style/values/specified/calc.rs +++ b/components/style/values/specified/calc.rs @@ -11,9 +11,9 @@ use cssparser::{Parser, Token}; use parser::ParserContext; use std::ascii::AsciiExt; use std::fmt; -use style_traits::ToCss; +use style_traits::{HasViewportPercentage, ToCss}; use style_traits::values::specified::AllowedLengthType; -use values::{CSSInteger, CSSFloat, HasViewportPercentage}; +use values::{CSSInteger, CSSFloat}; use values::specified::{Angle, Time}; use values::specified::length::{FontRelativeLength, NoCalcLength, ViewportPercentageLength}; diff --git a/components/style/values/specified/grid.rs b/components/style/values/specified/grid.rs index a4a8b930ef8..0633a0b0e80 100644 --- a/components/style/values/specified/grid.rs +++ b/components/style/values/specified/grid.rs @@ -8,8 +8,8 @@ use cssparser::{Parser, Token, serialize_identifier}; use parser::{Parse, ParserContext}; use std::{fmt, mem, usize}; use std::ascii::AsciiExt; -use style_traits::ToCss; -use values::{CSSFloat, CustomIdent, Either, HasViewportPercentage}; +use style_traits::{HasViewportPercentage, ToCss}; +use values::{CSSFloat, CustomIdent, Either}; use values::computed::{self, ComputedValueAsSpecified, Context, ToComputedValue}; use values::specified::{Integer, LengthOrPercentage}; diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 331901bf8c6..830b433b80c 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -14,11 +14,11 @@ use parser::{Parse, ParserContext}; use std::{cmp, fmt, mem}; use std::ascii::AsciiExt; use std::ops::Mul; -use style_traits::ToCss; +use style_traits::{HasViewportPercentage, ToCss}; use style_traits::values::specified::{AllowedLengthType, AllowedNumericType}; use stylesheets::CssRuleType; use super::{AllowQuirks, Number, ToComputedValue}; -use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, HasViewportPercentage, None_, Normal}; +use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, None_, Normal}; use values::ExtremumLength; use values::computed::{ComputedValueAsSpecified, Context}; use values::specified::calc::CalcNode; diff --git a/components/style/values/specified/position.rs b/components/style/values/specified/position.rs index a4b4953c372..085fea59300 100644 --- a/components/style/values/specified/position.rs +++ b/components/style/values/specified/position.rs @@ -10,8 +10,7 @@ use cssparser::Parser; use parser::{Parse, ParserContext}; use std::fmt; -use style_traits::ToCss; -use values::HasViewportPercentage; +use style_traits::{HasViewportPercentage, ToCss}; use values::computed::{CalcLengthOrPercentage, LengthOrPercentage as ComputedLengthOrPercentage}; use values::computed::{Context, ToComputedValue}; use values::generics::position::Position as GenericPosition; diff --git a/tests/unit/style/parsing/value.rs b/tests/unit/style/parsing/value.rs index 3a1f69746e4..5808f875747 100644 --- a/tests/unit/style/parsing/value.rs +++ b/tests/unit/style/parsing/value.rs @@ -8,8 +8,8 @@ use media_queries::CSSErrorReporterTest; use style::context::QuirksMode; use style::parser::{PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES, ParserContext}; use style::stylesheets::{CssRuleType, Origin}; -use style::values::HasViewportPercentage; use style::values::specified::{AbsoluteLength, NoCalcLength, Number, ViewportPercentageLength}; +use style_traits::HasViewportPercentage; #[test] fn length_has_viewport_percentage() { diff --git a/tests/unit/style/properties/viewport.rs b/tests/unit/style/properties/viewport.rs index 4444e19e023..ce4f879224e 100644 --- a/tests/unit/style/properties/viewport.rs +++ b/tests/unit/style/properties/viewport.rs @@ -5,8 +5,8 @@ use app_units::Au; use style::properties::PropertyDeclaration; use style::properties::longhands::border_top_width; -use style::values::HasViewportPercentage; use style::values::specified::{AbsoluteLength, Length, NoCalcLength, ViewportPercentageLength}; +use style_traits::HasViewportPercentage; #[test] fn has_viewport_percentage_for_specified_value() {