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

LibWeb: Add support for the text-justify property

This commit adds the text-justify property as defined in:
https://drafts.csswg.org/css-text/#propdef-text-justify
This commit is contained in:
sin-ack 2022-03-12 19:31:32 +00:00 committed by Andreas Kling
parent 7fe3f2d970
commit 0679eadd62
7 changed files with 50 additions and 0 deletions

View file

@ -438,6 +438,26 @@ Optional<CSS::TextAlign> StyleProperties::text_align() const
}
}
Optional<CSS::TextJustify> StyleProperties::text_justify() const
{
auto value = property(CSS::PropertyID::TextJustify);
if (!value.has_value())
return {};
switch (value.value()->to_identifier()) {
case CSS::ValueID::Auto:
return CSS::TextJustify::Auto;
case CSS::ValueID::None:
return CSS::TextJustify::None;
case CSS::ValueID::InterWord:
return CSS::TextJustify::InterWord;
case CSS::ValueID::Distribute:
case CSS::ValueID::InterCharacter:
return CSS::TextJustify::InterCharacter;
default:
return {};
}
}
Optional<CSS::PointerEvents> StyleProperties::pointer_events() const
{
auto value = property(CSS::PropertyID::PointerEvents);