mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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:
parent
629b6462dc
commit
2042993997
Notes:
sideshowbarker
2024-07-16 23:11:53 +09:00
Author: https://github.com/awesomekling
Commit: 2042993997
Pull-request: https://github.com/SerenityOS/serenity/pull/17763
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/nico
4 changed files with 11 additions and 11 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue