ladybird/Libraries/LibWeb/CSS/StyleValues/CustomIdentStyleValue.cpp
Andreas Kling d641bfd7e2 LibWeb: Store custom property names as UTF-16
Move PropertyNameAndID, custom property data, registered custom
properties, and Typed OM associated property names to Utf16FlyString.

This removes the FlyString storage boundary from CSS property-name
handling and lets CSSStyleProperties keep the name it receives from
CSSOM instead of converting it back to UTF-8.
2026-06-09 11:48:02 +02:00

25 lines
715 B
C++

/*
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "CustomIdentStyleValue.h"
#include <LibWeb/CSS/CSSKeywordValue.h>
#include <LibWeb/CSS/Parser/ComponentValue.h>
namespace Web::CSS {
Vector<Parser::ComponentValue> CustomIdentStyleValue::tokenize() const
{
return { Parser::Token::create_ident(m_custom_ident) };
}
// https://drafts.css-houdini.org/css-typed-om-1/#reify-ident
GC::Ref<CSSStyleValue> CustomIdentStyleValue::reify(JS::Realm& realm, Utf16FlyString const&) const
{
// 1. Return a new CSSKeywordValue with its value internal slot set to the serialization of ident.
return CSSKeywordValue::create(realm, m_custom_ident);
}
}