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

LibWeb: Make flex containers be Layout::Box

Flex containers were incorrectly represented as BlockContainer before,
which would make some CSS layout algorithms do the wrong thing.
This commit is contained in:
Andreas Kling 2023-01-23 15:03:45 +01:00
parent 51555dea7c
commit 44cf418975
2 changed files with 8 additions and 3 deletions

View file

@ -315,12 +315,15 @@ JS::GCPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Docume
if (display.is_flow_inside())
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
if (display.is_flex_inside())
return document.heap().allocate_without_realm<Layout::BlockContainer>(document, element, move(style));
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", display.to_deprecated_string());
return document.heap().allocate_without_realm<Layout::InlineNode>(document, element, move(style));
}
if (display.is_flow_inside() || display.is_flow_root_inside() || display.is_flex_inside() || display.is_grid_inside())
if (display.is_flex_inside())
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
if (display.is_flow_inside() || display.is_flow_root_inside() || display.is_grid_inside())
return document.heap().allocate_without_realm<Layout::BlockContainer>(document, element, move(style));
TODO();