1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibWeb: Simplify some code with CSS::LengthPercentage::is_auto()

This commit is contained in:
Andreas Kling 2022-07-21 16:34:25 +02:00
parent 3145f92bc0
commit 7aa9e03e85

View file

@ -376,15 +376,15 @@ bool FlexFormattingContext::is_cross_auto(Box const& box) const
bool FlexFormattingContext::is_main_axis_margin_first_auto(Box const& box) const
{
if (is_row_layout())
return box.computed_values().margin().left.is_length() && box.computed_values().margin().left.length().is_auto();
return box.computed_values().margin().top.is_length() && box.computed_values().margin().top.length().is_auto();
return box.computed_values().margin().left.length().is_auto();
return box.computed_values().margin().top.length().is_auto();
}
bool FlexFormattingContext::is_main_axis_margin_second_auto(Box const& box) const
{
if (is_row_layout())
return box.computed_values().margin().right.is_length() && box.computed_values().margin().right.length().is_auto();
return box.computed_values().margin().bottom.is_length() && box.computed_values().margin().bottom.length().is_auto();
return box.computed_values().margin().right.length().is_auto();
return box.computed_values().margin().bottom.length().is_auto();
}
void FlexFormattingContext::set_main_size(Box const& box, float size)