diff --git a/src/components/gfx/render_context.rs b/src/components/gfx/render_context.rs index 46278b97ca3..e58c318f5c5 100644 --- a/src/components/gfx/render_context.rs +++ b/src/components/gfx/render_context.rs @@ -306,9 +306,9 @@ impl<'a> RenderContext<'a> { } fn get_scaled_bounds(&self, - bounds : &Rect, - border : SideOffsets2D, - shrink_factor : f32) -> (Point2D, Point2D, Point2D, Point2D) { + bounds: &Rect, + border: SideOffsets2D, + shrink_factor: f32) -> (Point2D, Point2D, Point2D, Point2D) { let rect = bounds.to_azure_rect(); let scaled_border = SideOffsets2D::new(shrink_factor * border.top, @@ -334,10 +334,10 @@ impl<'a> RenderContext<'a> { } fn draw_groove_border_segment(&self, - direction : Direction, - bounds : &Rect, - border : SideOffsets2D, - color : Color) { + direction: Direction, + bounds: &Rect, + border: SideOffsets2D, + color: Color) { let rect = bounds.to_azure_rect(); let left_top = Point2D(rect.origin.x, rect.origin.y); let right_top = Point2D(rect.origin.x + rect.size.width, rect.origin.y); @@ -414,10 +414,10 @@ impl<'a> RenderContext<'a> { } fn draw_ridge_border_segment(&self, - direction : Direction, - bounds : &Rect, - border : SideOffsets2D, - color : Color) { + direction: Direction, + bounds: &Rect, + border: SideOffsets2D, + color: Color) { let rect = bounds.to_azure_rect(); let left_top = Point2D(rect.origin.x, rect.origin.y); let right_top = Point2D(rect.origin.x + rect.size.width, rect.origin.y); @@ -536,21 +536,21 @@ impl<'a> RenderContext<'a> { } fn draw_short_ended_path(&self, - left_top : Point2D, - right_top : Point2D, - left_bottom : Point2D, - right_bottom : Point2D, - direction : Direction, - border : SideOffsets2D, - color : Color, - short_end : ShortEnd) { + left_top: Point2D, + right_top: Point2D, + left_bottom: Point2D, + right_bottom: Point2D, + direction: Direction, + border: SideOffsets2D, + color: Color, + short_end: ShortEnd) { match direction { Top | Bottom => { - let left_border_short = match short_end { LeftShort | AllShort => { border.left } - _ => { 0.0 }}; - let right_border_short = match short_end { RightShort | AllShort => { border.right } - _ => { 0.0 }}; + let left_border_short = match short_end { LeftShort | AllShort => border.left, + _ => 0.0 }; + let right_border_short = match short_end { RightShort | AllShort => border.right, + _ => 0.0 }; self.draw_square_border_path(left_top + Point2D(left_border_short, 0.0), right_top + Point2D(-right_border_short, 0.0), left_bottom + Point2D(left_border_short, 0.0), @@ -563,10 +563,10 @@ impl<'a> RenderContext<'a> { color); } Left | Right => { - let top_border_short = match short_end { TopShort | AllShort => { border.top } - _ => { 0.0 }}; - let bottom_border_short = match short_end { BottomShort | AllShort => { border.bottom } - _ => { 0.0 }}; + let top_border_short = match short_end { TopShort | AllShort => border.top, + _ => 0.0 }; + let bottom_border_short = match short_end { BottomShort | AllShort => border.bottom, + _ => 0.0 }; self.draw_square_border_path(left_top + Point2D(0.0, top_border_short), right_top + Point2D(0.0, top_border_short), diff --git a/src/test/ref/basic.list b/src/test/ref/basic.list index 43def47ea67..566bb3b2024 100644 --- a/src/test/ref/basic.list +++ b/src/test/ref/basic.list @@ -16,6 +16,7 @@ == root_height_a.html root_height_b.html == png_rgba_colorspace_a.html png_rgba_colorspace_b.html == border_style_none_a.html border_style_none_b.html +== borders_a.html borders_b.html == acid1_a.html acid1_b.html # text_decoration_propagation_a.html text_decoration_propagation_b.html # inline_text_align_a.html inline_text_align_b.html diff --git a/src/test/ref/borders.png b/src/test/ref/borders.png new file mode 100644 index 00000000000..a0abba83ff6 Binary files /dev/null and b/src/test/ref/borders.png differ diff --git a/src/test/ref/borders_a.html b/src/test/ref/borders_a.html new file mode 100644 index 00000000000..4bd08b11a2a --- /dev/null +++ b/src/test/ref/borders_a.html @@ -0,0 +1,50 @@ + + + + + + +
+
+
+
+
+
+ + diff --git a/src/test/ref/borders_b.html b/src/test/ref/borders_b.html new file mode 100644 index 00000000000..d7d6399ced6 --- /dev/null +++ b/src/test/ref/borders_b.html @@ -0,0 +1,19 @@ + + + + + + +