From 992b4489ad65b6574205a7d2f36fb589191af877 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 15 Dec 2022 23:31:16 +0300 Subject: [PATCH] LibWeb: Fix bug in BFC that independent FC assigned to wrong variable Bug was introduced in 210bf8adf0c431be05659140fd6de3a2cc5b7d99 It makes new variable for independent_formatting_context instead of using earlier declared one which means that parent_context_did_dimension_child_root_box will never be called. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index e927713f50..2ed71c4687 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -377,7 +377,8 @@ void BlockFormattingContext::layout_block_level_box(Box const& box, BlockContain OwnPtr independent_formatting_context; if (!box.is_replaced_box() && box.has_children()) { - if (auto independent_formatting_context = create_independent_formatting_context_if_needed(m_state, box)) { + independent_formatting_context = create_independent_formatting_context_if_needed(m_state, box); + if (independent_formatting_context) { independent_formatting_context->run(box, layout_mode, box_state.available_inner_space_or_constraints_from(available_space)); } else { if (box.children_are_inline())