Render simple border colors again

This commit is contained in:
Brian Anderson 2012-11-03 00:30:04 -07:00
parent 8b2611ec90
commit 8646e341d5
4 changed files with 26 additions and 3 deletions

@ -1 +1 @@
Subproject commit 75aba2d0e4b1224ce55ba11423c78bc7eceaed6c
Subproject commit 9496e6d60d2a3f75aebcd63ad65a8d886a299960

@ -1 +1 @@
Subproject commit 62225a3af2c4d59da0d595287570cdfd71e7a4f6
Subproject commit 372d0334abe19eca4d9b9ba3e0948f81d586c14e

View file

@ -16,6 +16,10 @@ pub trait ComputeStyles {
fn compute_border_right_width(&self) -> CSSBorderWidth;
fn compute_border_bottom_width(&self) -> CSSBorderWidth;
fn compute_border_left_width(&self) -> CSSBorderWidth;
fn compute_border_top_color(&self) -> Color;
fn compute_border_right_color(&self) -> Color;
fn compute_border_bottom_color(&self) -> Color;
fn compute_border_left_color(&self) -> Color;
}
impl Node: ComputeStyles {
@ -38,6 +42,23 @@ impl Node: ComputeStyles {
fn compute_border_left_width(&self) -> CSSBorderWidth {
resolve(self, BdrWidthLength(Px(0.0)), |cs| cs.border_left_width() )
}
fn compute_border_top_color(&self) -> Color {
resolve(self, rgba(255, 255, 255, 0.0), |cs| cs.border_top_color() )
}
fn compute_border_right_color(&self) -> Color {
resolve(self, rgba(255, 255, 255, 0.0), |cs| cs.border_right_color() )
}
fn compute_border_bottom_color(&self) -> Color {
resolve(self, rgba(255, 255, 255, 0.0), |cs| cs.border_bottom_color() )
}
fn compute_border_left_color(&self) -> Color {
resolve(self, rgba(255, 255, 255, 0.0), |cs| cs.border_left_color() )
}
}
fn resolve<T>(node: &Node, default: T, get: &fn(cs: ComputedStyle) -> CSSValue<T>) -> T {

View file

@ -465,7 +465,9 @@ impl RenderBox : RenderBoxMethods {
height: abs_bounds.size.height + border_width
}
};
let color = rgb(0, 128, 255).to_gfx_color(); // FIXME
let top_color = self.d().node.compute_border_top_color();
let color = top_color.to_gfx_color(); // FIXME
list.append_item(~DisplayItem::new_Border(&bounds, border_width, color));
} else {