mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Treat percentage max-width as none during min-content sizing
...but only for non-replaced boxes. This is what CSS-SIZING-3 tells us to do, and we were already doing it for width, but neglecting max-width.
This commit is contained in:
parent
652e52d76a
commit
f00f975cf4
Notes:
github-actions[bot]
2025-09-28 17:26:15 +00:00
Author: https://github.com/awesomekling
Commit: f00f975cf4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6332
3 changed files with 43 additions and 1 deletions
|
|
@ -1926,11 +1926,15 @@ 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;
|
||||
// https://drafts.csswg.org/css-sizing-3/#cyclic-percentage-contribution
|
||||
if (max_width.contains_percentage()) {
|
||||
if (available_width.is_max_content())
|
||||
return true;
|
||||
if (available_width.is_min_content())
|
||||
if (available_width.is_min_content()) {
|
||||
if (!box.is_replaced_box())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if (!m_state.get(*box.non_anonymous_containing_block()).has_definite_width())
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue