mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibWeb: Add parsing for flex-wrap property
This commit is contained in:
parent
72d5394b8c
commit
e6545d5259
7 changed files with 38 additions and 0 deletions
|
@ -240,6 +240,23 @@ Optional<CSS::FlexDirection> StyleProperties::flex_direction() const
|
|||
}
|
||||
}
|
||||
|
||||
Optional<CSS::FlexWrap> StyleProperties::flex_wrap() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::FlexWrap);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
switch (value.value()->to_identifier()) {
|
||||
case CSS::ValueID::Wrap:
|
||||
return CSS::FlexWrap::Wrap;
|
||||
case CSS::ValueID::Nowrap:
|
||||
return CSS::FlexWrap::Nowrap;
|
||||
case CSS::ValueID::WrapReverse:
|
||||
return CSS::FlexWrap::WrapReverse;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
Optional<CSS::Position> StyleProperties::position() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue