LibWeb: Reject non-exclusive none in text-decoration-line

This updates the `parse_text_decoration_line_value` to reject values
which non-exclusively include `none` e.g. `underline none`.

It also simplifies handling by always producing a Vector (except for
`none`) and adding VERIFY_NOT_REACHED in more places which shouldn't be
reachable.
This commit is contained in:
Callum Law 2025-11-13 17:25:00 +13:00 committed by Jelle Raaijmakers
parent 5c0fdd371a
commit d6bb247bf7
Notes: github-actions[bot] 2025-11-13 09:16:20 +00:00
4 changed files with 20 additions and 13 deletions

View file

@ -1225,6 +1225,9 @@ Vector<TextDecorationLine> ComputedProperties::text_decoration_line() const
{
auto const& value = property(PropertyID::TextDecorationLine);
if (value.to_keyword() == Keyword::None)
return {};
if (value.is_value_list()) {
Vector<TextDecorationLine> lines;
auto& values = value.as_value_list().values();
@ -1234,14 +1237,7 @@ Vector<TextDecorationLine> ComputedProperties::text_decoration_line() const
return lines;
}
if (value.is_keyword()) {
if (value.to_keyword() == Keyword::None)
return {};
return { keyword_to_text_decoration_line(value.to_keyword()).release_value() };
}
dbgln("FIXME: Unsupported value for text-decoration-line: {}", value.to_string(SerializationMode::Normal));
return {};
VERIFY_NOT_REACHED();
}
TextDecorationStyle ComputedProperties::text_decoration_style() const