1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:17:34 +00:00

LibWeb: Ignore % max-width if box is sized under max-content constraint

When a box is sized under max-content constraint, any percentage value
set for max-width should be considered as if it were infinite. In other
words, it should have no effect on restricting the box's width.
This commit is contained in:
Aliaksandr Kalenik 2023-08-18 02:06:22 +02:00 committed by Andreas Kling
parent 0cda97b852
commit 37bd216c52
3 changed files with 29 additions and 0 deletions

View file

@ -1810,6 +1810,8 @@ bool FormattingContext::should_treat_max_width_as_none(Box const& box, Available
if (box.is_absolutely_positioned())
return false;
if (max_width.contains_percentage()) {
if (available_width.is_max_content())
return true;
if (available_width.is_min_content())
return false;
if (!m_state.get(*box.non_anonymous_containing_block()).has_definite_width())