mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
This commit is contained in:
parent
e394334739
commit
0c102e2350
37 changed files with 185 additions and 195 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue