mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Handle serialization of invalid font-variant in all contexts
Previously as we handled this in `get_property_internal` there were some contexts that we missed, for instance `CSSStyleProperties::serialized`.
This commit is contained in:
parent
d08d6b08d3
commit
09a5c04e5c
Notes:
github-actions[bot]
2025-07-15 13:27:42 +00:00
Author: https://github.com/Calme1709
Commit: 09a5c04e5c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5386
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 21 additions and 34 deletions
|
@ -344,6 +344,10 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const
|
|||
auto position = longhand(PropertyID::FontVariantPosition);
|
||||
auto emoji = longhand(PropertyID::FontVariantEmoji);
|
||||
|
||||
// If ligatures is `none` and any other value isn't `normal`, that's invalid.
|
||||
if (ligatures->to_keyword() == Keyword::None && !first_is_equal_to_all_of(Keyword::Normal, caps->to_keyword(), alternates->to_keyword(), numeric->to_keyword(), east_asian->to_keyword(), position->to_keyword(), emoji->to_keyword()))
|
||||
return ""_string;
|
||||
|
||||
Vector<String> values;
|
||||
if (ligatures->to_keyword() != Keyword::Normal)
|
||||
values.append(ligatures->to_string(mode));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue