mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibWeb: Make :enabled and :disabled selector handling more idiomatic
This commit is contained in:
parent
2ad98fdf80
commit
031322fde3
1 changed files with 4 additions and 4 deletions
|
@ -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<HTML::HTMLInputElement>(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<HTML::HTMLInputElement>(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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue