1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWeb: Make BFC always drive IFC

Instead of allowing FormattingContext to instantiate an IFC for anything
that has inline children, move this logic to BFC.

This is fine, since only BFC deals with blocks having inline children
anyway.
This commit is contained in:
Andreas Kling 2022-07-08 21:13:32 +02:00
parent db2d62671f
commit fd68be29ab
2 changed files with 10 additions and 8 deletions

View file

@ -432,11 +432,15 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b
OwnPtr<FormattingContext> independent_formatting_context;
if (child_box.can_have_children()) {
independent_formatting_context = create_independent_formatting_context_if_needed(m_state, child_box);
if (independent_formatting_context)
independent_formatting_context->run(child_box, layout_mode);
else
layout_block_level_children(verify_cast<BlockContainer>(child_box), layout_mode);
if (child_box.children_are_inline()) {
layout_inline_children(verify_cast<BlockContainer>(child_box), layout_mode);
} else {
independent_formatting_context = create_independent_formatting_context_if_needed(m_state, child_box);
if (independent_formatting_context)
independent_formatting_context->run(child_box, layout_mode);
else
layout_block_level_children(verify_cast<BlockContainer>(child_box), layout_mode);
}
}
compute_height(child_box, m_state);