stylo: Add support for <table> color quirk

MozReview-Commit-ID: 56IKARwfbhw
This commit is contained in:
Manish Goregaokar 2017-03-26 13:53:34 -07:00 committed by Manish Goregaokar
parent 0392e58a2f
commit 1c23296d8a
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
6 changed files with 62 additions and 25 deletions

View file

@ -107,24 +107,27 @@ impl ToCss for CSSColor {
}
}
impl From<Color> for CSSColor {
fn from(color: Color) -> Self {
CSSColor {
parsed: color,
authored: None,
}
}
}
impl CSSColor {
#[inline]
/// Returns currentcolor value.
pub fn currentcolor() -> CSSColor {
CSSColor {
parsed: Color::CurrentColor,
authored: None,
}
Color::CurrentColor.into()
}
#[inline]
/// Returns transparent value.
pub fn transparent() -> CSSColor {
CSSColor {
parsed: Color::RGBA(cssparser::RGBA::transparent()),
// This should probably be "transparent", but maybe it doesn't matter.
authored: None,
}
// We should probably set authored to "transparent", but maybe it doesn't matter.
Color::RGBA(cssparser::RGBA::transparent()).into()
}
}