mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Block layout should account for vertical border space
We were not accounting for space occupied by borders when computing the vertical (y) position of blocks. This meant that blocks with wide top/bottom borders could bleed into each other incorrectly. Fix this by using the combined padding+border geometry instead of just the padding when placing blocks on the y axis.
This commit is contained in:
parent
c39e29d186
commit
157896cc0b
Notes:
sideshowbarker
2024-07-19 01:03:25 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/157896cc0b8
1 changed files with 3 additions and 1 deletions
|
@ -499,7 +499,9 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl
|
|||
}
|
||||
|
||||
if (relevant_sibling) {
|
||||
y += relevant_sibling->effective_offset().y() + relevant_sibling->height() + relevant_sibling->box_model().padding.bottom.to_px(*relevant_sibling);
|
||||
y += relevant_sibling->effective_offset().y()
|
||||
+ relevant_sibling->height()
|
||||
+ relevant_sibling->box_model().border_box(*relevant_sibling).bottom;
|
||||
|
||||
// Collapse top margin with bottom margin of preceding siblings if needed
|
||||
float my_margin_top = box_model.margin.top.to_px(box);
|
||||
|
|
Loading…
Add table
Reference in a new issue