mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibWeb: Treat unresolvable percentage flex-basis values as 'content'
Per CSS-FLEXBOX-1, we should treat percentage values of flex-basis as 'content' if they resolve against an indefinite size of the flex container.
This commit is contained in:
parent
8f988b7bae
commit
0d5e0d27aa
3 changed files with 36 additions and 0 deletions
|
@ -572,6 +572,15 @@ CSS::FlexBasisData FlexFormattingContext::used_flex_basis_for_item(FlexItem cons
|
|||
}
|
||||
}
|
||||
|
||||
// For example, percentage values of flex-basis are resolved against the flex item’s containing block
|
||||
// (i.e. its flex container); and if that containing block’s size is indefinite,
|
||||
// the used value for flex-basis is content.
|
||||
if (flex_basis.type == CSS::FlexBasis::LengthPercentage
|
||||
&& flex_basis.length_percentage->is_percentage()
|
||||
&& !has_definite_main_size(flex_container())) {
|
||||
flex_basis.type = CSS::FlexBasis::Content;
|
||||
}
|
||||
|
||||
return flex_basis;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue