mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +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
|
@ -1030,9 +1030,9 @@ JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_name(DeprecatedString
|
|||
|
||||
JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_class_name(DeprecatedFlyString const& class_names)
|
||||
{
|
||||
Vector<DeprecatedFlyString> list_of_class_names;
|
||||
Vector<FlyString> list_of_class_names;
|
||||
for (auto& name : class_names.view().split_view(' ')) {
|
||||
list_of_class_names.append(name);
|
||||
list_of_class_names.append(FlyString::from_utf8(name).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
return HTMLCollection::create(*this, [list_of_class_names = move(list_of_class_names), quirks_mode = document().in_quirks_mode()](Element const& element) {
|
||||
for (auto& name : list_of_class_names) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue