diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-05-10 13:01:30 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-25 06:36:10 +0200 |
commit | 465ecf37c201ee893aac536869ea40cddd629186 (patch) | |
tree | b75cf5535e4b5a57682d135519451988e6294f50 /Meta | |
parent | 03613dc14d0462f411a2913f634ccc4143e2cf90 (diff) | |
download | serenity-465ecf37c201ee893aac536869ea40cddd629186.zip |
LibWeb: Make `property_id_from_string()` return Optional
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp index 425cbd81da..19d936a780 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp @@ -109,8 +109,8 @@ enum class PropertyID { generator.append(R"~~~( }; -PropertyID property_id_from_camel_case_string(StringView); -PropertyID property_id_from_string(StringView); +Optional<PropertyID> property_id_from_camel_case_string(StringView); +Optional<PropertyID> property_id_from_string(StringView); StringView string_from_property_id(PropertyID); bool is_inherited_property(PropertyID); ErrorOr<NonnullRefPtr<StyleValue>> property_initial_value(JS::Realm&, PropertyID); @@ -186,7 +186,7 @@ ErrorOr<void> generate_implementation_file(JsonObject& properties, Core::File& f namespace Web::CSS { -PropertyID property_id_from_camel_case_string(StringView string) +Optional<PropertyID> property_id_from_camel_case_string(StringView string) { )~~~"); @@ -204,10 +204,10 @@ PropertyID property_id_from_camel_case_string(StringView string) }); generator.append(R"~~~( - return PropertyID::Invalid; + return {}; } -PropertyID property_id_from_string(StringView string) +Optional<PropertyID> property_id_from_string(StringView string) { )~~~"); @@ -224,7 +224,7 @@ PropertyID property_id_from_string(StringView string) }); generator.append(R"~~~( - return PropertyID::Invalid; + return {}; } StringView string_from_property_id(PropertyID property_id) { |