From 0ae048102cf43e961fb5346bf5b9ca8072a3c856 Mon Sep 17 00:00:00 2001 From: Edwin Hoksberg Date: Mon, 24 Jun 2024 12:11:02 +0200 Subject: [PATCH] LibWeb: Resolve content-visibility fixme in html details element --- Tests/LibWeb/Layout/expected/details-closed.txt | 2 ++ Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/LibWeb/Layout/expected/details-closed.txt b/Tests/LibWeb/Layout/expected/details-closed.txt index 97fae02aeaa..1a08c616add 100644 --- a/Tests/LibWeb/Layout/expected/details-closed.txt +++ b/Tests/LibWeb/Layout/expected/details-closed.txt @@ -8,6 +8,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline "I'm a summary" TextNode <#text> ListItemMarkerBox <(anonymous)> at (8,8) content-size 12x17 children: not-inline + BlockContainer at (8,25) content-size 784x0 children: not-inline BlockContainer <(anonymous)> at (8,25) content-size 784x0 children: inline TextNode <#text> @@ -19,4 +20,5 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (ListItemBox) [32,8 760x17] TextPaintable (TextNode<#text>) MarkerPaintable (ListItemMarkerBox(anonymous)) [8,8 12x17] + PaintableWithLines (BlockContainer) [8,25 784x0] PaintableWithLines (BlockContainer(anonymous)) [8,25 784x0] diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 0d53390f273..4468f335c5c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -185,9 +185,8 @@ void HTMLDetailsElement::update_shadow_tree_style() display: block; )~~~"_string)); } else { - // FIXME: Should be `display: block` but we do not support `content-visibility: hidden`. MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~( - display: none; + display: block; content-visibility: hidden; )~~~"_string)); }