Truly independent web browser
LibWeb: Don't paint absent edges of a uniform double border
Andreas Kling805260b79c1a
diff --git a/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs b/Libraries/LibWeb/Rust/src/painting/record/paint/border.rsindex 542a9a94fff..edf35c02490 100644--- a/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs+++ b/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs@@ -1084,8 +1084,14 @@ fn paint_uniform_solid_border(// Two lines of a third of the width each, as paint_border splits a double edge. The inner ring is pulled in// by the gap between the lines, which also takes that much off each radius, and its inner outline is the- // padding box either way.- let line_widths = widths.map(|width| split_line_width(width, 1.0 / 3.0));+ // padding box either way. An absent edge stays absent rather than being clamped up to a 1px line.+ let line_widths = widths.map(|width| {+ if width > 0 {+ split_line_width(width, 1.0 / 3.0)+ } else {+ 0+ }+ });painter.fill_rounded_rect_ring(border_rect,corner_radii,diff --git a/Tests/LibWeb/Ref/expected/double-border-on-one-edge-ref.html b/Tests/LibWeb/Ref/expected/double-border-on-one-edge-ref.htmlnew file mode 100644index 00000000000..b8476f775b9--- /dev/null+++ b/Tests/LibWeb/Ref/expected/double-border-on-one-edge-ref.html@@ -0,0 +1,21 @@+<!DOCTYPE html>+<style>+ body {+ margin: 0;+ background: white;+ }+ div {+ box-sizing: border-box;+ margin: 20px;+ width: 200px;+ height: 60px;+ border-top: 1px solid black;+ }+ span {+ display: block;+ margin-top: 1px;+ height: 1px;+ background: black;+ }+</style>+<div><span></span></div>diff --git a/Tests/LibWeb/Ref/input/double-border-on-one-edge.html b/Tests/LibWeb/Ref/input/double-border-on-one-edge.htmlnew file mode 100644index 00000000000..c6584da6217--- /dev/null+++ b/Tests/LibWeb/Ref/input/double-border-on-one-edge.html@@ -0,0 +1,16 @@+<!DOCTYPE html>+<link rel="match" href="../expected/double-border-on-one-edge-ref.html" />+<style>+ body {+ margin: 0;+ background: white;+ }+ div {+ box-sizing: border-box;+ margin: 20px;+ width: 200px;+ height: 60px;+ border-top: 3px double black;+ }+</style>+<div></div>