diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 1752676817..b782a2c384 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -13,8 +13,14 @@ #include #include #include +#include +#include #include #include +#include +#include +#include +#include namespace Web::SelectorEngine { @@ -228,7 +234,8 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla case CSS::Selector::SimpleSelector::PseudoClass::Type::Enabled: // https://html.spec.whatwg.org/multipage/semantics-other.html#selector-enabled // The :enabled pseudo-class must match any button, input, select, textarea, optgroup, option, fieldset element, or form-associated custom element that is not actually disabled. - return !element.is_actually_disabled(); + return (is(element) || is(element) || is(element) || is(element) || is(element) || is(element) || is(element)) + && !element.is_actually_disabled(); case CSS::Selector::SimpleSelector::PseudoClass::Type::Checked: return matches_checked_pseudo_class(element); case CSS::Selector::SimpleSelector::PseudoClass::Type::Is: