diff options
author | Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | 2023-02-10 17:31:11 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-10 20:55:33 +0100 |
commit | 2ed54157501973f16bcfc08720a3cffcc7cea158 (patch) | |
tree | 0af2cea11c25499443b88a24fccd987f17bd0c71 /Userland/Libraries | |
parent | 0cd63f851e0624eb0cce151ddd34821c81123401 (diff) | |
download | serenity-2ed54157501973f16bcfc08720a3cffcc7cea158.zip |
LibWeb: Fix clearance to update y offset within current block
If a box has clearance and margin bottom of preceding box is greater
than static y of the box then it should also affect y offset in current
block container so subsequent boxes will get correct y position too.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 92198e0f15..e4b6d66ad9 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -636,6 +636,8 @@ void BlockFormattingContext::place_block_level_element_in_normal_flow_vertically for (auto* containing_block = child_box.containing_block(); containing_block && containing_block != &root(); containing_block = containing_block->containing_block()) clearance_y_in_containing_block -= m_state.get(*containing_block).offset.y(); + if (clearance_y_in_containing_block > y) + m_y_offset_of_current_block_container = clearance_y_in_containing_block; y = max(y, clearance_y_in_containing_block); float_side.clear(); } |