LibWeb: Create a BlockContainer for 'block ruby' elements

Prevents the layout engine from crashing.
(and unlocks ~200 new subtests)
This commit is contained in:
Gingeh 2025-02-04 10:23:09 +11:00 committed by Tim Ledbetter
parent be3e221b3f
commit bc0729f5d2
Notes: github-actions[bot] 2025-02-16 19:41:11 +00:00

View file

@ -461,6 +461,11 @@ GC::Ptr<Layout::NodeWithStyle> Element::create_layout_node_for_display_type(DOM:
return document.heap().allocate<Layout::BlockContainer>(document, element, move(style));
dbgln("FIXME: CSS display '{}' not implemented yet.", display.to_string());
// FIXME: We don't actually support `display: block ruby`, this is just a hack to prevent a crash
if (display.is_ruby_inside())
return document.heap().allocate<Layout::BlockContainer>(document, element, move(style));
return document.heap().allocate<Layout::InlineNode>(document, element, move(style));
}