LibWeb: Layout children a bit earlier in BlockFormattingContext
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

We don't need to duplicate this piece of code. No functional changes.
This commit is contained in:
Jelle Raaijmakers 2025-03-30 10:51:50 +01:00 committed by Andreas Kling
parent 04ba375cc7
commit 86b831750d
Notes: github-actions[bot] 2025-03-31 07:12:04 +00:00

View file

@ -75,12 +75,12 @@ void BlockFormattingContext::run(AvailableSpace const& available_space)
return;
}
if (is<FieldSetBox>(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<FieldSetBox>(root())) {
auto const& fieldset_box = as<FieldSetBox>(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<Box>(); child_box; child_box = child_box->previous_sibling_of_type<Box>()) {