diff --git a/components/style/font_face.rs b/components/style/font_face.rs index f320bb0e2018..c5e9e330f82f 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -15,7 +15,7 @@ use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser}; use parser::{ParserContext, log_css_error, Parse}; use std::fmt; use std::iter; -use style_traits::{ToCss, CommaSeparated}; +use style_traits::{ToCss, OneOrMoreCommaSeparated}; use values::specified::url::SpecifiedUrl; /// A source for a font-face rule. @@ -46,7 +46,7 @@ impl ToCss for Source { } } -impl CommaSeparated for Source {} +impl OneOrMoreCommaSeparated for Source {} /// A `UrlSource` represents a font-face source that has been specified with a /// `url()` function. @@ -323,7 +323,7 @@ pub mod unicode_range { use cssparser::{Parser, Token}; use parser::{ParserContext, Parse}; use std::fmt; - use style_traits::{ToCss, CommaSeparated}; + use style_traits::{ToCss, OneOrMoreCommaSeparated}; /// Maximum value of the end of a range pub const MAX: u32 = ::std::char::MAX as u32; @@ -338,7 +338,7 @@ pub mod unicode_range { pub end: u32, } - impl CommaSeparated for Range {} + impl OneOrMoreCommaSeparated for Range {} impl Parse for Range { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { diff --git a/components/style/parser.rs b/components/style/parser.rs index e325547b368d..a9d153529843 100644 --- a/components/style/parser.rs +++ b/components/style/parser.rs @@ -11,7 +11,7 @@ use error_reporting::ParseErrorReporter; #[cfg(feature = "gecko")] use gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI}; use servo_url::ServoUrl; -use style_traits::CommaSeparated; +use style_traits::OneOrMoreCommaSeparated; use stylesheets::{MemoryHoleReporter, Origin}; /// Extra data that the style backend may need to parse stylesheets. @@ -104,7 +104,7 @@ pub trait Parse : Sized { fn parse(context: &ParserContext, input: &mut Parser) -> Result; } -impl Parse for Vec where T: Parse + CommaSeparated { +impl Parse for Vec where T: Parse + OneOrMoreCommaSeparated { fn parse(context: &ParserContext, input: &mut Parser) -> Result { input.parse_comma_separated(|input| T::parse(context, input)) } diff --git a/components/style_traits/lib.rs b/components/style_traits/lib.rs index bc66db33d9d8..4eadd6404026 100644 --- a/components/style_traits/lib.rs +++ b/components/style_traits/lib.rs @@ -59,4 +59,4 @@ pub mod cursor; pub mod values; pub mod viewport; -pub use values::{ToCss, CommaSeparated}; +pub use values::{ToCss, OneOrMoreCommaSeparated}; diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 5c23d74fbfa7..d59520c626d3 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -25,9 +25,9 @@ pub trait ToCss { } /// Marker trait to automatically implement ToCss for Vec. -pub trait CommaSeparated {} +pub trait OneOrMoreCommaSeparated {} -impl ToCss for Vec where T: ToCss + CommaSeparated { +impl ToCss for Vec where T: ToCss + OneOrMoreCommaSeparated { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { let mut iter = self.iter(); iter.next().unwrap().to_css(dest)?;