mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:05:08 +00:00
LibWeb: Cache the used CSS text-align property on LayoutNodeWithStyle
This commit is contained in:
parent
ae181e1573
commit
f4ecb5362f
6 changed files with 28 additions and 16 deletions
|
@ -229,19 +229,19 @@ bool StyleProperties::operator==(const StyleProperties& other) const
|
|||
return true;
|
||||
}
|
||||
|
||||
CSS::ValueID StyleProperties::text_align() const
|
||||
CSS::TextAlign StyleProperties::text_align() const
|
||||
{
|
||||
auto string = string_or_fallback(CSS::PropertyID::TextAlign, "left");
|
||||
if (string == "center")
|
||||
return CSS::ValueID::Center;
|
||||
return CSS::TextAlign::Center;
|
||||
if (string == "right")
|
||||
return CSS::ValueID::Right;
|
||||
return CSS::TextAlign::Right;
|
||||
if (string == "justify")
|
||||
return CSS::ValueID::Justify;
|
||||
return CSS::TextAlign::Justify;
|
||||
if (string == "-libweb-center")
|
||||
return CSS::ValueID::VendorSpecificCenter;
|
||||
return CSS::TextAlign::VendorSpecificCenter;
|
||||
// Otherwise, just assume "left"..
|
||||
return CSS::ValueID::Left;
|
||||
return CSS::TextAlign::Left;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue