mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +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:
parent
7fe3f2d970
commit
0679eadd62
7 changed files with 50 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue