style: Merge the two scrollbar color properties into scrollbar-color.

Differential Revision: https://phabricator.services.mozilla.com/D6115
This commit is contained in:
Xidorn Quan 2018-09-19 05:33:12 +00:00 committed by Emilio Cobos Álvarez
parent 5c66290142
commit 0bcffa7094
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 94 additions and 16 deletions

View file

@ -122,3 +122,21 @@ impl From<MozForceBrokenImageIcon> for u8 {
}
}
}
/// A specified value for `scrollbar-color` property
pub type ScrollbarColor = generics::ScrollbarColor<Color>;
impl Parse for ScrollbarColor {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
return Ok(generics::ScrollbarColor::Auto);
}
Ok(generics::ScrollbarColor::Colors {
thumb: Color::parse(context, input)?,
track: Color::parse(context, input)?,
})
}
}