From 6c5ba10bb025e863a0567c5b1f6110f2b0233108 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 9 Jan 2023 08:30:56 +0300 Subject: [PATCH] LibWeb: Remove redundant check for empty anonymous blocks It is incorrect to skip anonymous block containers without line boxes during block auto height calculation because there might be table roots wrapped in anonymous table boxes after fixup and their height should be taken in account so leaving just condition to skip child boxes which margins are "collapsed through" (`border_box_height() == 0`) sufficient to skip anonymous blocks without lines but still consider table wrappers. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 54e7446da7..402feae8c9 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -413,10 +413,6 @@ CSSPixels BlockFormattingContext::compute_auto_height_for_block_level_element(Bo auto const& child_box_state = m_state.get(*child_box); - // Ignore anonymous block containers with no lines. These don't count as in-flow block boxes. - if (child_box->is_anonymous() && child_box->is_block_container() && child_box_state.line_boxes.is_empty()) - continue; - if (margins_collapse_through(*child_box, m_state)) { continue; }