1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Add missing null check of independent formatting context in FFC

When calling layout_inside() on a flex item that can't have children of
its own, layout_inside() will not return an independent formatting
context, so we need to handle that case here.
This commit is contained in:
Andreas Kling 2022-04-11 01:20:24 +02:00
parent fc8c4ea23f
commit 57feb0f3ec

View file

@ -129,8 +129,8 @@ void FlexFormattingContext::run(Box const& run_box, LayoutMode layout_mode)
// AD-HOC: Layout the inside of all flex items.
copy_dimensions_from_flex_items_to_boxes();
for (auto& flex_item : m_flex_items) {
auto independent_formatting_context = layout_inside(flex_item.box, LayoutMode::Normal);
independent_formatting_context->parent_context_did_dimension_child_root_box();
if (auto independent_formatting_context = layout_inside(flex_item.box, LayoutMode::Normal))
independent_formatting_context->parent_context_did_dimension_child_root_box();
}
// FIXME: We run the "copy dimensions" step *again* here, in order to override any sizes