mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:27:34 +00:00
LibWeb: Add border box top/bottom metrics to line box fragments
This will allow us to support more kinds of vertical alignment.
This commit is contained in:
parent
8b369bf7bd
commit
797f51e122
6 changed files with 22 additions and 10 deletions
|
@ -219,8 +219,12 @@ float FormattingContext::compute_auto_height_for_block_level_element(FormattingS
|
|||
top = 0;
|
||||
if (!line_boxes.is_empty()) {
|
||||
for (auto& fragment : line_boxes.last().fragments()) {
|
||||
if (!bottom.has_value() || (fragment.offset().y() + fragment.height()) > bottom.value())
|
||||
bottom = fragment.offset().y() + fragment.height();
|
||||
float fragment_top = fragment.offset().y() - fragment.border_box_top();
|
||||
if (!top.has_value() || fragment_top < *top)
|
||||
top = fragment_top;
|
||||
float fragment_bottom = fragment.offset().y() + fragment.height() + fragment.border_box_bottom();
|
||||
if (!bottom.has_value() || fragment_bottom > *bottom)
|
||||
bottom = fragment_bottom;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue