LibWeb: Allow any FC type for replaced boxes in dimension_box_on_line()

If box is sized as replaced it still could be anything, not only SVG.

This fixes crashing on https://www.shopify.com/ that was caused by a
missing paintable for a box that has a layout node. This occurred
because the box was not laid out in dimension_box_on_line().
This commit is contained in:
Aliaksandr Kalenik
2024-03-23 19:04:38 +01:00
committed by Andreas Kling
parent e1fbb08747
commit 26a516c85f
3 changed files with 27 additions and 3 deletions

View File

@@ -120,9 +120,9 @@ void InlineFormattingContext::dimension_box_on_line(Box const& box, LayoutMode l
if (box_is_sized_as_replaced_element(box)) {
box_state.set_content_width(compute_width_for_replaced_element(box, *m_available_space));
box_state.set_content_height(compute_height_for_replaced_element(box, *m_available_space));
if (is<SVGSVGBox>(box))
(void)layout_inside(box, layout_mode, box_state.available_inner_space_or_constraints_from(*m_available_space));
auto independent_formatting_context = layout_inside(box, layout_mode, box_state.available_inner_space_or_constraints_from(*m_available_space));
if (independent_formatting_context)
independent_formatting_context->parent_context_did_dimension_child_root_box();
return;
}