1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibWeb: Remove setting length to 0px if it is not definite

If available width (or height) is max-content and width (or height)
value is 100% it should be resolved in infinite px, not 0 px.

Fixes #18639
This commit is contained in:
Aliaksandr Kalenik 2023-05-04 23:39:13 +03:00 committed by Andreas Kling
parent b443c0b80b
commit 0318ac5ce4
3 changed files with 13 additions and 6 deletions

View file

@ -1289,9 +1289,6 @@ CSS::Length FormattingContext::calculate_inner_width(Layout::Box const& box, Ava
return width.resolved(box, width_of_containing_block_as_length_for_resolve).resolved(box);
}
if (!available_width.is_definite())
width_of_containing_block_as_length_for_resolve = CSS::Length::make_px(0);
auto& computed_values = box.computed_values();
if (computed_values.box_sizing() == CSS::BoxSizing::BorderBox) {
auto const padding_left = computed_values.padding().left().resolved(box, width_of_containing_block_as_length_for_resolve).resolved(box);
@ -1316,9 +1313,6 @@ CSS::Length FormattingContext::calculate_inner_height(Layout::Box const& box, Av
return height.resolved(box, height_of_containing_block_as_length_for_resolve).resolved(box);
}
if (!available_height.is_definite())
height_of_containing_block_as_length_for_resolve = CSS::Length::make_px(0);
auto& computed_values = box.computed_values();
if (computed_values.box_sizing() == CSS::BoxSizing::BorderBox) {
auto width_of_containing_block = CSS::Length::make_px(containing_block_width_for(box));