mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Make Element::has_class() an inline function
This is extremely hot when running CSS selectors, so let's make it easier for it to be inlined.
This commit is contained in:
parent
b40f0415ef
commit
a6c23d3db5
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/awesomekling
Commit: a6c23d3db5
Pull-request: https://github.com/SerenityOS/serenity/pull/23637
2 changed files with 12 additions and 13 deletions
|
@ -374,19 +374,6 @@ Vector<String> Element::get_attribute_names() const
|
|||
return names;
|
||||
}
|
||||
|
||||
bool Element::has_class(FlyString const& class_name, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
if (case_sensitivity == CaseSensitivity::CaseSensitive) {
|
||||
return any_of(m_classes, [&](auto& it) {
|
||||
return it == class_name;
|
||||
});
|
||||
} else {
|
||||
return any_of(m_classes, [&](auto& it) {
|
||||
return it.equals_ignoring_ascii_case(class_name);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> Element::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
if (local_name() == "noscript" && document().is_scripting_enabled())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue