mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Add letter-spacing css property to Node
This commit is contained in:
parent
6c3ecf6a34
commit
537cbf55c3
Notes:
github-actions[bot]
2024-10-22 14:33:32 +00:00
Author: https://github.com/kostyafarber
Commit: 537cbf55c3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1911
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 26 additions and 1 deletions
|
@ -687,7 +687,7 @@ Variant<LengthOrCalculated, NumberOrCalculated> StyleProperties::tab_size() cons
|
|||
{
|
||||
auto value = property(CSS::PropertyID::TabSize);
|
||||
if (value->is_math()) {
|
||||
auto& math_value = value->as_math();
|
||||
auto const& math_value = value->as_math();
|
||||
if (math_value.resolves_to_length()) {
|
||||
return LengthOrCalculated { math_value };
|
||||
}
|
||||
|
@ -724,6 +724,22 @@ Optional<CSS::WhiteSpace> StyleProperties::white_space() const
|
|||
return keyword_to_white_space(value->to_keyword());
|
||||
}
|
||||
|
||||
Optional<LengthOrCalculated> StyleProperties::letter_spacing() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::LetterSpacing);
|
||||
if (value->is_math()) {
|
||||
auto const& math_value = value->as_math();
|
||||
if (math_value.resolves_to_length()) {
|
||||
return LengthOrCalculated { math_value };
|
||||
}
|
||||
}
|
||||
|
||||
if (value->is_length())
|
||||
return LengthOrCalculated { value->as_length().length() };
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Optional<CSS::LineStyle> StyleProperties::line_style(CSS::PropertyID property_id) const
|
||||
{
|
||||
auto value = property(property_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue