From 7bd6a5b868396147057c4402222c56c53cda409a Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sat, 31 Dec 2022 16:53:33 +0000 Subject: [PATCH] LibWeb: Treat `border-style: hidden` the same as `border-style: none` The only difference between these two values is that `hidden` has different behaviour for border conflict resolution for border-collapsed tables in table layout, which we don't have yet. This gets rid of the main border around the repository information on the GitHub repository page. --- Userland/Libraries/LibWeb/Layout/Node.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 86f2e02b0c..f731ef3ca6 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -543,7 +543,13 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) // specified first, so it's far from ideal. border.color = computed_style.color_or_fallback(color_property, *this, computed_values.color()); border.line_style = computed_style.line_style(style_property).value_or(CSS::LineStyle::None); - if (border.line_style == CSS::LineStyle::None) { + + // https://w3c.github.io/csswg-drafts/css-backgrounds/#border-style + // none + // No border. Color and width are ignored (i.e., the border has width 0). Note this means that the initial value of border-image-width will also resolve to zero. + // hidden + // Same as none, but has different behavior in the border conflict resolution rules for border-collapsed tables [CSS2]. + if (border.line_style == CSS::LineStyle::None || border.line_style == CSS::LineStyle::Hidden) { border.width = 0; } else { auto resolve_border_width = [&]() {