LibWeb: Escape serialized custom idents

This commit is contained in:
Callum Law 2025-09-16 21:37:15 +12:00 committed by Tim Ledbetter
parent c5e6e4fd95
commit 2ff1ae6155
3 changed files with 8 additions and 8 deletions

View File

@ -7,6 +7,7 @@
#pragma once
#include <AK/FlyString.h>
#include <LibWeb/CSS/Serialize.h>
#include <LibWeb/CSS/StyleValues/StyleValue.h>
namespace Web::CSS {
@ -22,7 +23,7 @@ public:
FlyString const& custom_ident() const { return m_custom_ident; }
virtual String to_string(SerializationMode) const override { return m_custom_ident.to_string(); }
virtual String to_string(SerializationMode) const override { return serialize_an_identifier(m_custom_ident.to_string()); }
virtual Vector<Parser::ComponentValue> tokenize() const override;
virtual GC::Ref<CSSStyleValue> reify(JS::Realm& realm, String const&) const override;

View File

@ -2,8 +2,7 @@ Harness status: OK
Found 27 tests
25 Pass
2 Fail
27 Pass
Pass Property animation-name value 'none'
Pass Property animation-name value 'NONE'
Pass Property animation-name value 'foo'
@ -13,8 +12,8 @@ Pass Property animation-name value 'infinite'
Pass Property animation-name value 'paused'
Pass Property animation-name value 'first, second, third'
Pass Property animation-name value '"something"'
Fail Property animation-name value '"---\22---"'
Fail Property animation-name value '"multi word string"'
Pass Property animation-name value '"---\22---"'
Pass Property animation-name value '"multi word string"'
Pass Property animation-name value '"none"'
Pass Property animation-name value '"none", "INITIAL", "inherit"'
Pass Property animation-name value '"none", both, ease-in'

View File

@ -2,8 +2,8 @@ Harness status: OK
Found 263 tests
256 Pass
7 Fail
257 Pass
6 Fail
Pass accent-color
Pass border-collapse
Pass border-spacing
@ -82,7 +82,7 @@ Pass animation-direction
Pass animation-duration
Pass animation-fill-mode
Pass animation-iteration-count
Fail animation-name
Pass animation-name
Pass animation-play-state
Pass animation-timing-function
Pass appearance