From 2f29e6120389a0752e26d4033d64fbd76bcc88c9 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 13 May 2020 22:17:29 +0100 Subject: LibWeb: Make CSS pseudo classes case-insensitive --- Libraries/LibWeb/Parser/CSSParser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Libraries') diff --git a/Libraries/LibWeb/Parser/CSSParser.cpp b/Libraries/LibWeb/Parser/CSSParser.cpp index 7820209ae7..5af4284381 100644 --- a/Libraries/LibWeb/Parser/CSSParser.cpp +++ b/Libraries/LibWeb/Parser/CSSParser.cpp @@ -400,19 +400,19 @@ public: if (is_pseudo_element) return {}; - if (pseudo_name == "link") + if (pseudo_name.equals_ignoring_case("link")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Link; - else if (pseudo_name == "hover") + else if (pseudo_name.equals_ignoring_case("hover")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Hover; - else if (pseudo_name == "focus") + else if (pseudo_name.equals_ignoring_case("focus")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Focus; - else if (pseudo_name == "first-child") + else if (pseudo_name.equals_ignoring_case("first-child")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::FirstChild; - else if (pseudo_name == "last-child") + else if (pseudo_name.equals_ignoring_case("last-child")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::LastChild; - else if (pseudo_name == "only-child") + else if (pseudo_name.equals_ignoring_case("only-child")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::OnlyChild; - else if (pseudo_name == "empty") + else if (pseudo_name.equals_ignoring_case("empty")) simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Empty; } -- cgit v1.2.3