mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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:
parent
5c0fdd371a
commit
d6bb247bf7
Notes:
github-actions[bot]
2025-11-13 09:16:20 +00:00
Author: https://github.com/Calme1709
Commit: d6bb247bf7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6808
Reviewed-by: https://github.com/gmta ✅
4 changed files with 20 additions and 13 deletions
|
|
@ -4691,7 +4691,7 @@ RefPtr<StyleValue const> Parser::parse_text_decoration_line_value(TokenStream<Co
|
|||
if (auto maybe_line = keyword_to_text_decoration_line(value->to_keyword()); maybe_line.has_value()) {
|
||||
if (maybe_line == TextDecorationLine::None) {
|
||||
if (!style_values.is_empty())
|
||||
break;
|
||||
return nullptr;
|
||||
return value;
|
||||
}
|
||||
if (first_is_one_of(*maybe_line, TextDecorationLine::SpellingError, TextDecorationLine::GrammarError)) {
|
||||
|
|
@ -4703,7 +4703,7 @@ RefPtr<StyleValue const> Parser::parse_text_decoration_line_value(TokenStream<Co
|
|||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
if (style_values.is_empty())
|
||||
|
|
@ -4713,9 +4713,6 @@ RefPtr<StyleValue const> Parser::parse_text_decoration_line_value(TokenStream<Co
|
|||
if (style_values.size() > 1 && includes_spelling_or_grammar_error_value)
|
||||
return nullptr;
|
||||
|
||||
if (style_values.size() == 1)
|
||||
return *style_values.first();
|
||||
|
||||
quick_sort(style_values, [](auto& left, auto& right) {
|
||||
return *keyword_to_text_decoration_line(left->to_keyword()) < *keyword_to_text_decoration_line(right->to_keyword());
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue