style: Unbox a bunch of color properties.

This builds on https://github.com/servo/rust-cssparser/pull/118.
This commit is contained in:
Emilio Cobos Álvarez 2017-02-12 15:17:45 +01:00
parent e394334739
commit 0c102e2350
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
37 changed files with 185 additions and 195 deletions

View file

@ -43,14 +43,14 @@ no_viewport_percentage!(i32); // For PropertyDeclaration::Order
#[allow(missing_docs)]
pub struct CSSColor {
pub parsed: cssparser::Color,
pub authored: Option<String>,
pub authored: Option<Box<str>>,
}
impl Parse for CSSColor {
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
let start_position = input.position();
let authored = match input.next() {
Ok(Token::Ident(s)) => Some(s.into_owned()),
Ok(Token::Ident(s)) => Some(s.into_owned().into_boxed_str()),
_ => None,
};
input.reset(start_position);
@ -77,7 +77,7 @@ impl ToCss for CSSColor {
#[allow(missing_docs)]
pub struct CSSRGBA {
pub parsed: cssparser::RGBA,
pub authored: Option<String>,
pub authored: Option<Box<str>>,
}
no_viewport_percentage!(CSSRGBA);