1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:35:08 +00:00

LibWeb: Make property/media-feature name matching ASCII case-insensitive

https://www.w3.org/TR/css-conditional-3/#dom-css-supports specifically
asks for this when calling `CSS::property_id_from_string()`, but in
general, CSS property and media-feature names can only contain ASCII.
This commit is contained in:
Sam Atkins 2023-02-17 16:43:28 +00:00 committed by Linus Groh
parent 05b5a3bfba
commit f0b72b819e
2 changed files with 6 additions and 3 deletions

View file

@ -154,6 +154,7 @@ ErrorOr<void> generate_implementation_file(JsonObject& properties, Core::File& f
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/StyleValue.h>
#include <LibWeb/Infra/Strings.h>
namespace Web::CSS {
@ -189,7 +190,7 @@ PropertyID property_id_from_string(StringView string)
member_generator.set("name", name);
member_generator.set("name:titlecase", title_casify(name));
member_generator.append(R"~~~(
if (string.equals_ignoring_case("@name@"sv))
if (Infra::is_ascii_case_insensitive_match(string, "@name@"sv))
return PropertyID::@name:titlecase@;
)~~~");
});