Skip to content

Commit

Permalink
Fix CSSKeywordValue serialization to properly escape identifier
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247022

Reviewed by Antti Koivisto.

Fix CSSKeywordValue serialization to properly escape identifier.

* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/stylevalue-serialization/cssKeywordValue.tentative-expected.txt:
* Source/WebCore/css/typedom/CSSKeywordValue.cpp:
(WebCore::CSSKeywordValue::serialize const):

Canonical link: https://commits.webkit.org/256022@main
  • Loading branch information
cdumez committed Oct 26, 2022
1 parent 52f26a2 commit 3f16ccf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -1,6 +1,6 @@

PASS CSSKeywordValue constructed from IDL serializes correctly
FAIL CSSKeywordValue constructed from IDL serializes to escaped strings assert_equals: expected "\\ Hello\\ World" but got " Hello World"
PASS CSSKeywordValue constructed from IDL serializes to escaped strings
PASS CSSKeywordValue from DOMString modified through "value" setter serializes correctly
PASS CSSKeywordValue from CSSOM modified through "value" setter serializes correctly

3 changes: 2 additions & 1 deletion Source/WebCore/css/typedom/CSSKeywordValue.cpp
Expand Up @@ -30,6 +30,7 @@
#include "config.h"
#include "CSSKeywordValue.h"

#include "CSSMarkup.h"
#include "ExceptionOr.h"
#include <wtf/IsoMallocInlines.h>

Expand Down Expand Up @@ -68,7 +69,7 @@ ExceptionOr<void> CSSKeywordValue::setValue(const String& value)
void CSSKeywordValue::serialize(StringBuilder& builder, OptionSet<SerializationArguments>) const
{
// https://drafts.css-houdini.org/css-typed-om/#keywordvalue-serialization
builder.append(m_value);
serializeIdentifier(m_value, builder);
}

} // namespace WebCore

0 comments on commit 3f16ccf

Please sign in to comment.