mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Fix bug where box-sizing: border-box made flex items too small
If a flex item has a preferred cross size of "auto", we should not be subtracting padding and border in the cross axis when computing the cross size.
This commit is contained in:
@@ -1099,7 +1099,7 @@ void FlexFormattingContext::determine_hypothetical_cross_size_of_item(FlexItem&
|
||||
}
|
||||
|
||||
auto cross_size = [&]() {
|
||||
if (item.box->computed_values().box_sizing() == CSS::BoxSizing::BorderBox) {
|
||||
if (item.box->computed_values().box_sizing() == CSS::BoxSizing::BorderBox && !should_treat_cross_size_as_auto(item.box)) {
|
||||
return max(CSSPixels(0.0f), resolved_definite_cross_size(item) - item.padding.cross_before - item.padding.cross_after - item.borders.cross_before - item.borders.cross_after);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user