1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

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.
This commit is contained in:
Aliaksandr Kalenik 2023-02-10 17:31:11 +03:00 committed by Andreas Kling
parent 0cd63f851e
commit 2ed5415750
3 changed files with 41 additions and 0 deletions

View file

@ -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();
}