1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:47:36 +00:00

LibWeb: Convert DOM::Element::m_classes to the new AK::FlyString

This makes selector matching significantly faster by not forcing us to
convert from FlyString to DeprecatedFlyString when matching class
selectors. :^)
This commit is contained in:
Andreas Kling 2023-03-07 19:54:01 +01:00
parent 629b6462dc
commit 2042993997
4 changed files with 11 additions and 11 deletions

View file

@ -354,7 +354,7 @@ static inline bool matches(CSS::Selector::SimpleSelector const& component, DOM::
case CSS::Selector::SimpleSelector::Type::Id:
return component.name() == element.attribute(HTML::AttributeNames::id).view();
case CSS::Selector::SimpleSelector::Type::Class:
return element.has_class(component.name().bytes_as_string_view());
return element.has_class(component.name());
case CSS::Selector::SimpleSelector::Type::TagName:
// See https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors
if (element.document().document_type() == DOM::Document::Type::HTML)