1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibWeb: Support list-style-position

This moves the ::marker inside of <summary> actually inside. :^)
This commit is contained in:
Simon Wanner 2023-06-02 23:05:15 +02:00 committed by Andreas Kling
parent ee7282cbe4
commit 293ece2292
10 changed files with 34 additions and 8 deletions

View file

@ -999,8 +999,14 @@ 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());
marker_state.set_content_offset({ -(marker_state.content_width() + default_marker_width),
max(CSSPixels(0), (CSSPixels(marker.line_height()) - marker_state.content_height()) / 2) });
auto final_marker_width = marker_state.content_width() + default_marker_width;
if (marker.list_style_position() == CSS::ListStylePosition::Inside) {
list_item_state.set_content_offset({ final_marker_width, list_item_state.offset.y() });
list_item_state.set_content_width(list_item_state.content_width() - final_marker_width);
}
marker_state.set_content_offset({ -final_marker_width, max(CSSPixels(0), (CSSPixels(marker.line_height()) - marker_state.content_height()) / 2) });
if (marker_state.content_height() > list_item_state.content_height())
list_item_state.set_content_height(marker_state.content_height());