mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
LibWeb: Use Element::id() in SelectorEngine
This makes ID selector matching O(1) instead of O(n).
This commit is contained in:
parent
1c62ee9396
commit
83c3490bc4
1 changed files with 1 additions and 1 deletions
|
@ -583,7 +583,7 @@ static inline bool matches(CSS::Selector::SimpleSelector const& component, Optio
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
case CSS::Selector::SimpleSelector::Type::Id:
|
||||
return component.name() == element.deprecated_attribute(HTML::AttributeNames::id).view();
|
||||
return component.name() == element.id();
|
||||
case CSS::Selector::SimpleSelector::Type::Class:
|
||||
return element.has_class(component.name());
|
||||
case CSS::Selector::SimpleSelector::Type::Attribute:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue