mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
gfx: Fix border-radius panic when a corner has 0px and >0px borders
When one border is 0px and the other is >0px then the border corner drawing code panics when computing the values to use in drawing the border corner arcs. This fixes that bug and makes the `draw_corner` function more robust by explicitly passing an enum, `BorderCorner`, naming which corner is being drawn e.g. `BorderCorner::TL`. Add a ref test, `border_radius_zero_sizes_a.html/border_radius_zero_sizes_ref.html`. Fixes https://github.com/servo/servo/issues/7700.
This commit is contained in:
parent
61267cde63
commit
071acf476b
4 changed files with 146 additions and 27 deletions
|
@ -69,6 +69,7 @@ flaky_cpu == append_style_a.html append_style_b.html
|
|||
== border_radius_elliptical_a.html border_radius_elliptical_ref.html
|
||||
== border_radius_overlapping_a.html border_radius_overlapping_ref.html
|
||||
== border_radius_shorthand_a.html border_radius_shorthand_ref.html
|
||||
== border_radius_zero_sizes_a.html border_radius_zero_sizes_ref.html
|
||||
== border_rounding_1px_invisible_issue_7184_a.html border_rounding_1px_invisible_issue_7184_ref.html
|
||||
== border_spacing_a.html border_spacing_ref.html
|
||||
== border_spacing_auto_layout_a.html border_spacing_ref.html
|
||||
|
|
10
tests/ref/border_radius_zero_sizes_a.html
Normal file
10
tests/ref/border_radius_zero_sizes_a.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div style="border-top: 20px solid black; border-radius: 5px"></div>
|
||||
<div style="border-right: 30px solid black; border-radius: 15px; height: 30px"></div>
|
||||
<div style="border-bottom: 20px solid black; border-radius: 5px"></div>
|
||||
<div style="border-left: 30px solid black; border-radius: 15px; height: 30px"></div>
|
||||
</body>
|
||||
</html>
|
10
tests/ref/border_radius_zero_sizes_ref.html
Normal file
10
tests/ref/border_radius_zero_sizes_ref.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div style="border: 10px solid black; border-top-left-radius: 5px; border-top-right-radius: 5px"></div>
|
||||
<div style="border-right: 30px solid black; border-top-right-radius: 15px; border-bottom-right-radius: 15px; height: 30px"></div>
|
||||
<div style="border: 10px solid black; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px"></div>
|
||||
<div style="border-left: 30px solid black; border-bottom-left-radius: 15px; border-top-left-radius: 15px; height: 30px"></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue