ladybird/Libraries/LibWeb/CSS/StyleValues/DimensionStyleValue.h
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

32 lines
793 B
C++

/*
* Copyright (c) 2024-2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
#include <LibWeb/CSS/Parser/ComponentValue.h>
#include <LibWeb/CSS/Parser/Token.h>
#include <LibWeb/CSS/StyleValues/StyleValue.h>
namespace Web::CSS {
class WEB_API DimensionStyleValue : public StyleValue {
public:
virtual ~DimensionStyleValue() override = default;
virtual double raw_value() const = 0;
virtual FlyString unit_name() const = 0;
virtual Vector<Parser::ComponentValue> tokenize() const override;
virtual GC::Ref<CSSStyleValue> reify(JS::Realm&, Utf16FlyString const& associated_property) const override;
protected:
explicit DimensionStyleValue(Type type)
: StyleValue(type)
{
}
};
}