mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibWeb: Parse flex-basis
Flex-basis accepts either 'content' or a Length.
This commit is contained in:
parent
27704f5f9e
commit
ae3e6510d6
7 changed files with 39 additions and 0 deletions
|
@ -257,6 +257,21 @@ Optional<CSS::FlexWrap> StyleProperties::flex_wrap() const
|
|||
}
|
||||
}
|
||||
|
||||
Optional<CSS::FlexBasisData> StyleProperties::flex_basis() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::FlexBasis);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
|
||||
if (value.value()->is_identifier() && value.value()->to_identifier() == CSS::ValueID::Content)
|
||||
return { { CSS::FlexBasis::Content, {} } };
|
||||
|
||||
if (value.value()->is_length())
|
||||
return { { CSS::FlexBasis::Length, value.value()->to_length() } };
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<CSS::Position> StyleProperties::position() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue