From 031322fde39b83f5d2427a8d78b21df7f16543bd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 27 Jul 2022 17:18:32 +0200 Subject: [PATCH] LibWeb: Make :enabled and :disabled selector handling more idiomatic --- Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index d31b7ad564..f2d0586af7 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -211,15 +211,15 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla case CSS::Selector::SimpleSelector::PseudoClass::Type::Lang: return matches_lang_pseudo_class(element, pseudo_class.languages); case CSS::Selector::SimpleSelector::PseudoClass::Type::Disabled: - if (!element.tag_name().equals_ignoring_case(HTML::TagNames::input)) + if (!is(element)) return false; - if (!element.has_attribute("disabled")) + if (!element.has_attribute(HTML::AttributeNames::disabled)) return false; return true; case CSS::Selector::SimpleSelector::PseudoClass::Type::Enabled: - if (!element.tag_name().equals_ignoring_case(HTML::TagNames::input)) + if (!is(element)) return false; - if (element.has_attribute("disabled")) + if (element.has_attribute(HTML::AttributeNames::disabled)) return false; return true; case CSS::Selector::SimpleSelector::PseudoClass::Type::Checked: