summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wanner <simon+git@skyrising.xyz>2023-06-02 23:07:25 +0200
committerAndreas Kling <kling@serenityos.org>2023-06-03 05:54:49 +0200
commit870bcd56df13a0a6123c0d15228105e31b7292a6 (patch)
treee04c5809daa234778cf72e949df166735b7cff34
parent293ece229288996a2f7087cd38cc78378cbe7316 (diff)
downloadserenity-870bcd56df13a0a6123c0d15228105e31b7292a6.zip
LibWeb: Make disclosure marker bounds square
This makes sure we actually render an equilateral triangle inside a square.
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index 2213eb1b16..17961989c1 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -999,6 +999,9 @@ void BlockFormattingContext::layout_list_item_marker(ListItemBox const& list_ite
marker_state.set_content_height(max(image_height, marker.font().pixel_size_rounded_up() + 1).value());
+ if (marker.list_style_type() == CSS::ListStyleType::DisclosureClosed || marker.list_style_type() == CSS::ListStyleType::DisclosureOpen)
+ marker_state.set_content_width(marker_state.content_height());
+
auto final_marker_width = marker_state.content_width() + default_marker_width;
if (marker.list_style_position() == CSS::ListStylePosition::Inside) {