mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Propagate margin and offset when computing a box's baseline
When traversing the layout tree to find an appropriate box child to derive the baseline from. Only the child's margin and offset was being applied. Now we sum each offset on the recursive call.
This commit is contained in:
parent
c8e29ad691
commit
3c897e7cf3
Notes:
sideshowbarker
2024-07-16 17:12:03 +09:00
Author: https://github.com/BenJilks
Commit: 3c897e7cf3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/649
32 changed files with 134 additions and 80 deletions
|
@ -1886,7 +1886,7 @@ CSSPixels FormattingContext::box_baseline(Box const& box) const
|
|||
if (!box_state.line_boxes.is_empty())
|
||||
return box_state.margin_box_top() + box_state.offset.y() + box_state.line_boxes.last().baseline();
|
||||
if (auto const* child_box = box_child_to_derive_baseline_from(box)) {
|
||||
return box_baseline(*child_box);
|
||||
return box_state.margin_box_top() + box_state.offset.y() + box_baseline(*child_box);
|
||||
}
|
||||
// If none of the children have a baseline set, the bottom margin edge of the box is used.
|
||||
return box_state.margin_box_height();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue