LibWeb: Treat a CSS declaration with a "--" property name as invalid

This commit is contained in:
Tim Ledbetter 2025-06-25 11:55:17 +01:00 committed by Sam Atkins
commit 7a6e4f5ec8
Notes: github-actions[bot] 2025-06-25 16:10:39 +00:00
3 changed files with 31 additions and 0 deletions

View file

@ -1125,6 +1125,8 @@ Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& input, Neste
// 8. If decls name is a custom property name string, then set decls original text to the segment
// of the original source text string corresponding to the tokens of decls value.
if (is_invalid_custom_property_name_string(declaration.name))
return {};
if (is_a_custom_property_name_string(declaration.name)) {
// TODO: If we could reach inside the source string that the TokenStream uses, we could grab this as
// a single substring instead of having to reconstruct it.