mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Parse the CSS "flex-direction" property
This commit is contained in:
parent
fd7920fa8f
commit
149f10b0b9
Notes:
sideshowbarker
2024-07-18 23:07:07 +09:00
Author: https://github.com/awesomekling
Commit: 149f10b0b9
7 changed files with 43 additions and 0 deletions
|
@ -225,6 +225,25 @@ Optional<int> StyleProperties::z_index() const
|
|||
return static_cast<int>(value.value()->to_length().raw_value());
|
||||
}
|
||||
|
||||
Optional<CSS::FlexDirection> StyleProperties::flex_direction() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::FlexDirection);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
switch (value.value()->to_identifier()) {
|
||||
case CSS::ValueID::Row:
|
||||
return CSS::FlexDirection::Row;
|
||||
case CSS::ValueID::RowReverse:
|
||||
return CSS::FlexDirection::RowReverse;
|
||||
case CSS::ValueID::Column:
|
||||
return CSS::FlexDirection::Column;
|
||||
case CSS::ValueID::ColumnReverse:
|
||||
return CSS::FlexDirection::ColumnReverse;
|
||||
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