mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
LibWeb: Make :checked selector actually look at checkedness
It was incorrectly testing for presence of the "checked" attribute.
This commit is contained in:
parent
d2ade9800f
commit
eec34ae0e9
1 changed files with 2 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/AttributeNames.h>
|
||||
#include <LibWeb/HTML/HTMLHtmlElement.h>
|
||||
#include <LibWeb/HTML/HTMLInputElement.h>
|
||||
|
||||
namespace Web::SelectorEngine {
|
||||
|
||||
|
@ -105,9 +106,7 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
|
|||
case CSS::Selector::SimpleSelector::PseudoClass::Type::Checked:
|
||||
if (!element.tag_name().equals_ignoring_case(HTML::TagNames::input))
|
||||
return false;
|
||||
if (!element.has_attribute("checked"))
|
||||
return false;
|
||||
return true;
|
||||
return static_cast<HTML::HTMLInputElement const&>(element).checked();
|
||||
case CSS::Selector::SimpleSelector::PseudoClass::Type::Not:
|
||||
for (auto& selector : pseudo_class.not_selector) {
|
||||
if (matches(selector, element))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue