Selaa lähdekoodia

LibWeb: Make CSS property parsing case-insensitive

These are all valid:

background-COLOR: red;
Background-Color: red;
BACKGROUND-COLOR: red;
BaCkGrOuNd-CoLoR: red;
Linus Groh 5 vuotta sitten
vanhempi
commit
d8cdf3f5e1

+ 1 - 1
Libraries/LibWeb/CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp.cpp

@@ -67,7 +67,7 @@ int main(int argc, char** argv)
 
     json.as_object().for_each_member([&](auto& name, auto& value) {
         ASSERT(value.is_object());
-        out() << "    if (string == \"" << name << "\")";
+        out() << "    if (string.equals_ignoring_case(\"" << name << "\"))";
         out() << "        return PropertyID::" << title_casify(name) << ";";
     });