LibWeb: Prevent infinite recursion on abspos w/ intrinsic max-size

We were incorrectly deciding that abspos elements shouldn't treat many
max-width and max-height values as `none`. My best understanding is that
this was a hack in 2023 for an issue that has been solved since then.

By removing the incorrect short-circuit, we stop at least one WPT test
from crashing due to infinite recursion and get ourselves +34 passes.
This commit is contained in:
Andreas Kling 2025-04-24 13:10:12 +02:00 committed by Andreas Kling
parent e5d62e9915
commit f7a7cd9b2b
Notes: github-actions[bot] 2025-04-24 16:28:19 +00:00
3 changed files with 372 additions and 4 deletions

View file

@ -1914,8 +1914,6 @@ bool FormattingContext::should_treat_max_width_as_none(Box const& box, Available
return true;
if (available_width.is_max_content() && max_width.is_max_content())
return true;
if (box.is_absolutely_positioned())
return false;
if (max_width.contains_percentage()) {
if (available_width.is_max_content())
return true;
@ -1942,8 +1940,6 @@ bool FormattingContext::should_treat_max_height_as_none(Box const& box, Availabl
auto const& max_height = box.computed_values().max_height();
if (max_height.is_none())
return true;
if (box.is_absolutely_positioned())
return false;
if (max_height.contains_percentage()) {
if (available_height.is_min_content())
return false;