mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Add FFC helpers for getting the computed main/cross size of box
This commit is contained in:
parent
a4d7dc40bf
commit
18b1854aea
2 changed files with 11 additions and 0 deletions
|
@ -1710,4 +1710,13 @@ bool FlexFormattingContext::flex_item_is_stretched(FlexItem const& item) const
|
|||
return computed_cross_size.is_auto() && !item.margins.cross_before_is_auto && !item.margins.cross_after_is_auto;
|
||||
}
|
||||
|
||||
CSS::LengthPercentage const& FlexFormattingContext::computed_main_size(Box const& box) const
|
||||
{
|
||||
return is_row_layout() ? box.computed_values().width() : box.computed_values().height();
|
||||
}
|
||||
CSS::LengthPercentage const& FlexFormattingContext::computed_cross_size(Box const& box) const
|
||||
{
|
||||
return !is_row_layout() ? box.computed_values().width() : box.computed_values().height();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue