style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.

A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.
This commit is contained in:
Jonathan Chan 2017-06-19 15:35:58 -07:00
parent e41b7d06b4
commit 26179b3660
6 changed files with 64 additions and 14 deletions

View file

@ -20,7 +20,7 @@ use parser::{ParserContext, log_css_error, Parse};
use selectors::parser::SelectorParseError;
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use std::fmt;
use style_traits::{ToCss, OneOrMoreCommaSeparated, ParseError, StyleParseError};
use style_traits::{ToCss, OneOrMoreSeparated, CommaSeparator, ParseError, StyleParseError};
use values::specified::url::SpecifiedUrl;
/// A source for a font-face rule.
@ -34,7 +34,9 @@ pub enum Source {
Local(FamilyName),
}
impl OneOrMoreCommaSeparated for Source {}
impl OneOrMoreSeparated for Source {
type S = CommaSeparator;
}
/// A `UrlSource` represents a font-face source that has been specified with a
/// `url()` function.