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

LibWeb: Support fit-content width for block-level boxes

This commit is contained in:
Andreas Kling 2023-05-26 19:04:01 +02:00
parent a277c393b9
commit 1bb4e5c428
3 changed files with 21 additions and 0 deletions

View file

@ -1347,6 +1347,9 @@ CSS::Length FormattingContext::calculate_inner_width(Layout::Box const& box, Ava
if (width.is_auto()) {
return width.resolved(box, width_of_containing_block_as_length_for_resolve);
}
if (width.is_fit_content()) {
return CSS::Length::make_px(calculate_fit_content_width(box, AvailableSpace { available_width, AvailableSize::make_indefinite() }));
}
auto& computed_values = box.computed_values();
if (computed_values.box_sizing() == CSS::BoxSizing::BorderBox) {