mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb: Don't treat non-replaced sizes as 0 for min-content contrib
This behavior is part of the cyclic percentage contribution logic from CSS-SIZING-3 which explicitly only applies to non-replaced boxes. This fixes an issue on Discord where buttons in the settings UI were cropped to a narrower width than intended. Fixes #3572
This commit is contained in:
parent
34f0ac15fd
commit
8d02f28cc2
Notes:
github-actions[bot]
2025-07-23 17:54:06 +00:00
Author: https://github.com/awesomekling
Commit: 8d02f28cc2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5579
8 changed files with 117 additions and 2 deletions
|
@ -632,8 +632,10 @@ void FlexFormattingContext::determine_flex_base_size(FlexItem& item)
|
|||
}
|
||||
|
||||
// AD-HOC: If we're sizing the flex container under a min-content constraint in the main axis,
|
||||
// flex items resolve percentages in the main axis to 0.
|
||||
if (m_available_space_for_items->main.is_min_content()
|
||||
// non-replaced flex items resolve percentages in the main axis to 0.
|
||||
// https://drafts.csswg.org/css-sizing-3/#cyclic-percentage-contribution
|
||||
if (item.box->is_replaced_box()
|
||||
&& m_available_space_for_items->main.is_min_content()
|
||||
&& computed_main_size(item.box).contains_percentage()) {
|
||||
return CSSPixels(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue