LibWeb/Layout: Store computed style for ::marker

This lets us refer to its properties later, for example to resolve its
counters.
This commit is contained in:
Sam Atkins 2025-06-19 10:47:17 +01:00
parent 67241d6419
commit a6df9e1bac
Notes: github-actions[bot] 2025-06-19 11:37:02 +00:00

View file

@ -723,6 +723,7 @@ void TreeBuilder::update_layout_tree_after_children(DOM::Node& dom_node, GC::Ref
auto marker_style = style_computer.compute_style(element, CSS::PseudoElement::Marker);
auto list_item_marker = document.heap().allocate<ListItemMarkerBox>(document, layout_node->computed_values().list_style_type(), layout_node->computed_values().list_style_position(), element, marker_style);
static_cast<ListItemBox&>(*layout_node).set_marker(list_item_marker);
element.set_pseudo_element_computed_properties(CSS::PseudoElement::Marker, marker_style);
element.set_pseudo_element_node({}, CSS::PseudoElement::Marker, list_item_marker);
layout_node->prepend_child(*list_item_marker);
}