mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Render simple border colors again
This commit is contained in:
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
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue