mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibWeb: Allow flex-basis: {min,max,fit}-content
This commit is contained in:
parent
9df41954c0
commit
9c02ace897
Notes:
sideshowbarker
2024-07-16 20:12:13 +09:00
Author: https://github.com/awesomekling
Commit: 9c02ace897
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/258
4 changed files with 61 additions and 1 deletions
|
@ -603,6 +603,15 @@ void FlexFormattingContext::determine_flex_base_size_and_hypothetical_main_size(
|
|||
// in this calculation use fit-content as the flex item’s cross size.
|
||||
// The flex base size is the item’s resulting main size.
|
||||
|
||||
if (auto* size = item.used_flex_basis->get_pointer<CSS::Size>()) {
|
||||
if (size->is_fit_content())
|
||||
return calculate_fit_content_main_size(item);
|
||||
if (size->is_max_content())
|
||||
return calculate_max_content_main_size(item);
|
||||
if (size->is_min_content())
|
||||
return calculate_min_content_main_size(item);
|
||||
}
|
||||
|
||||
// NOTE: If the flex item has a definite main size, just use that as the flex base size.
|
||||
if (has_definite_main_size(item))
|
||||
return inner_main_size(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue