mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Fix infinite recursion when grid has "max-width: max-content"
With this change "max-width: max-content" is treated as "none" when the available width is also "max-content". This fix prevents a stack overflow in the grid track size maximization algorithm by avoiding recursive calls to calculate_max_width() when determining the maximum grid container size.
This commit is contained in:
parent
8e2102fb73
commit
aee5120078
Notes:
sideshowbarker
2024-07-16 20:21:48 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: aee5120078
Pull-request: https://github.com/SerenityOS/serenity/pull/23277
4 changed files with 43 additions and 10 deletions
|
@ -1857,6 +1857,8 @@ bool FormattingContext::should_treat_max_width_as_none(Box const& box, Available
|
|||
auto const& max_width = box.computed_values().max_width();
|
||||
if (max_width.is_none())
|
||||
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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue