LibWeb: Move and rename CSSStyleValue to StyleValues/StyleValue.{h,cpp}

This reverts 0e3487b9ab.

Back when I made that change, I thought we could make our StyleValue
classes match the typed-om definitions directly. However, they have
different requirements. Typed-om types need to be mutable and GCed,
whereas StyleValues are immutable and ideally wouldn't require a JS VM.

While I was already making such a cataclysmic change, I've moved it into
the StyleValues directory, because it *not* being there has bothered me
for a long time. 😅
This commit is contained in:
Sam Atkins 2025-08-08 10:11:51 +01:00 committed by Tim Ledbetter
commit c57975c9fd
Notes: github-actions[bot] 2025-08-08 14:20:54 +00:00
167 changed files with 989 additions and 990 deletions

View file

@ -254,7 +254,7 @@ Optional<PropertyID> property_id_from_string(StringView);
[[nodiscard]] FlyString const& string_from_property_id(PropertyID);
[[nodiscard]] FlyString const& camel_case_string_from_property_id(PropertyID);
bool is_inherited_property(PropertyID);
NonnullRefPtr<CSSStyleValue const> property_initial_value(PropertyID);
NonnullRefPtr<StyleValue const> property_initial_value(PropertyID);
bool property_accepts_type(PropertyID, ValueType);
bool property_accepts_keyword(PropertyID, Keyword);
@ -449,8 +449,8 @@ ErrorOr<void> generate_implementation_file(JsonObject& properties, JsonObject& l
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/PropertyName.h>
#include <LibWeb/CSS/CSSStyleValue.h>
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/StyleValue.h>
#include <LibWeb/CSS/StyleValues/TimeStyleValue.h>
#include <LibWeb/Infra/Strings.h>
@ -706,9 +706,9 @@ bool property_affects_stacking_context(PropertyID property_id)
}
}
NonnullRefPtr<CSSStyleValue const> property_initial_value(PropertyID property_id)
NonnullRefPtr<StyleValue const> property_initial_value(PropertyID property_id)
{
static Array<RefPtr<CSSStyleValue const>, to_underlying(last_property_id) + 1> initial_values;
static Array<RefPtr<StyleValue const>, to_underlying(last_property_id) + 1> initial_values;
if (auto initial_value = initial_values[to_underlying(property_id)])
return initial_value.release_nonnull();