Merge CSSColor into Color.

This commit is contained in:
Xidorn Quan 2017-06-08 10:42:27 +10:00
parent bf77f81ed6
commit 7568a19688
25 changed files with 181 additions and 264 deletions

View file

@ -111,7 +111,7 @@ use style::stylearc::Arc;
use style::stylist::ApplicableDeclarationBlock;
use style::thread_state;
use style::values::{CSSFloat, Either};
use style::values::specified::{self, CSSColor, Color};
use style::values::specified;
use stylesheet_loader::StylesheetOwner;
// TODO: Update focus state when the top-level browsing context gains or loses system focus,
@ -420,8 +420,8 @@ impl LayoutElementHelpers for LayoutJS<Element> {
if let Some(color) = bgcolor {
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::BackgroundColor(
CSSColor { parsed: Color::RGBA(color), authored: None })));
PropertyDeclaration::BackgroundColor(color.into())
));
}
let background = if let Some(this) = self.downcast::<HTMLBodyElement>() {
@ -455,10 +455,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
hints.push(from_declaration(
shared_lock,
PropertyDeclaration::Color(
longhands::color::SpecifiedValue(CSSColor {
parsed: Color::RGBA(color),
authored: None,
})
longhands::color::SpecifiedValue(color.into())
)
));
}