diff --git a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 98da121b0ba..2fb3c120d62 100644 --- a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -75,12 +75,12 @@ void BlockFormattingContext::run(AvailableSpace const& available_space) return; } - if (is(root())) { - if (root().children_are_inline()) - layout_inline_children(root(), available_space); - else - layout_block_level_children(root(), available_space); + if (root().children_are_inline()) + layout_inline_children(root(), available_space); + else + layout_block_level_children(root(), available_space); + if (is(root())) { auto const& fieldset_box = as(root()); if (!(fieldset_box.has_rendered_legend())) { return; @@ -107,11 +107,6 @@ void BlockFormattingContext::run(AvailableSpace const& available_space) return; } - if (root().children_are_inline()) - layout_inline_children(root(), available_space); - else - layout_block_level_children(root(), available_space); - // Assign collapsed margin left after children layout of formatting context to the last child box if (m_margin_state.current_collapsed_margin() != 0) { for (auto* child_box = root().last_child_of_type(); child_box; child_box = child_box->previous_sibling_of_type()) {