LibWeb: Update property_id_from_string() generator to handle ::Custom

This commit is contained in:
Aliaksandr Kalenik 2024-11-20 17:28:23 +01:00 committed by Alexander Kalenik
parent a1687854ab
commit 0448d4d609
Notes: github-actions[bot] 2024-11-21 12:17:33 +00:00

View file

@ -402,6 +402,7 @@ ErrorOr<void> generate_implementation_file(JsonObject& properties, Core::File& f
#include <LibWeb/CSS/Enums.h> #include <LibWeb/CSS/Enums.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/PropertyID.h> #include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/PropertyName.h>
#include <LibWeb/CSS/CSSStyleValue.h> #include <LibWeb/CSS/CSSStyleValue.h>
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h> #include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/TimeStyleValue.h> #include <LibWeb/CSS/StyleValues/TimeStyleValue.h>
@ -436,6 +437,9 @@ Optional<PropertyID> property_id_from_camel_case_string(StringView string)
Optional<PropertyID> property_id_from_string(StringView string) Optional<PropertyID> property_id_from_string(StringView string)
{ {
if (is_a_custom_property_name_string(string))
return PropertyID::Custom;
if (Infra::is_ascii_case_insensitive_match(string, "all"sv)) if (Infra::is_ascii_case_insensitive_match(string, "all"sv))
return PropertyID::All; return PropertyID::All;
)~~~"); )~~~");