mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb: Apply the word-spacing css property to Node
This will let us start to begin applying this during text shaping.
This commit is contained in:
parent
e4533e5595
commit
da42c19cb6
Notes:
github-actions[bot]
2024-10-22 12:37:23 +00:00
Author: https://github.com/kostyafarber
Commit: da42c19cb6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1860
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 25 additions and 0 deletions
|
@ -702,6 +702,22 @@ Variant<LengthOrCalculated, NumberOrCalculated> StyleProperties::tab_size() cons
|
|||
return NumberOrCalculated { value->as_number().number() };
|
||||
}
|
||||
|
||||
Optional<CSS::LengthOrCalculated> StyleProperties::word_spacing() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::WordSpacing);
|
||||
if (value->is_math()) {
|
||||
auto& 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::WhiteSpace> StyleProperties::white_space() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::WhiteSpace);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue