mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibWeb: Prevent max-width expanding the width
This commit is contained in:
parent
c006a1ef41
commit
bf3144fcff
3 changed files with 14 additions and 1 deletions
|
@ -255,7 +255,7 @@ void BlockFormattingContext::compute_width(Box const& box, AvailableSpace const&
|
|||
// but this time using the computed value of 'max-width' as the computed value for 'width'.
|
||||
if (!should_treat_max_width_as_none(box, available_space.width)) {
|
||||
auto max_width = calculate_inner_width(box, remaining_available_space.width, computed_values.max_width());
|
||||
auto used_width_px = used_width.is_auto() ? remaining_available_space.width.to_px() : used_width.to_px(box);
|
||||
auto used_width_px = used_width.is_auto() ? CSSPixels { 0 } : used_width.to_px(box);
|
||||
if (used_width_px > max_width.to_px(box)) {
|
||||
used_width = try_compute_width(max_width);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue