mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibWeb: Add proper parsing of the AlignItems property
This teaches all the relevant places about 'align-items'.
This commit is contained in:
parent
51b42e0463
commit
307f90b675
5 changed files with 37 additions and 0 deletions
|
@ -424,6 +424,27 @@ Optional<CSS::JustifyContent> StyleProperties::justify_content() const
|
|||
}
|
||||
}
|
||||
|
||||
Optional<CSS::AlignItems> StyleProperties::align_items() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::AlignItems);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
switch (value.value()->to_identifier()) {
|
||||
case CSS::ValueID::FlexStart:
|
||||
return CSS::AlignItems::FlexStart;
|
||||
case CSS::ValueID::FlexEnd:
|
||||
return CSS::AlignItems::FlexEnd;
|
||||
case CSS::ValueID::Center:
|
||||
return CSS::AlignItems::Center;
|
||||
case CSS::ValueID::Baseline:
|
||||
return CSS::AlignItems::Baseline;
|
||||
case CSS::ValueID::Stretch:
|
||||
return CSS::AlignItems::Stretch;
|
||||
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