summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-02-05 17:41:43 +0200
committerAndreas Kling <kling@serenityos.org>2022-02-05 16:48:14 +0100
commitdb324664997287489b9f137b9a6403035172de68 (patch)
tree9c5c033185a46d12a452f770911a340f6306b6a0 /Userland/Libraries/LibWeb/CSS
parent89bd4cd80dd51f32da9d6d48f5d619d4d96ab405 (diff)
downloadserenity-db324664997287489b9f137b9a6403035172de68.zip
LibWeb: Mark SelectorEngine matches-related functions as inline
The prologues and epilogues of these functions were pretty hot in a profile of Browser, so this should help a bit.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r--Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
index fef535a51f..98a5b76ead 100644
--- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
+++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp
@@ -15,7 +15,7 @@
namespace Web::SelectorEngine {
-static bool matches_hover_pseudo_class(DOM::Element const& element)
+static inline bool matches_hover_pseudo_class(DOM::Element const& element)
{
auto* hovered_node = element.document().hovered_node();
if (!hovered_node)
@@ -25,7 +25,7 @@ static bool matches_hover_pseudo_class(DOM::Element const& element)
return element.is_ancestor_of(*hovered_node);
}
-static bool matches_attribute(CSS::Selector::SimpleSelector::Attribute const& attribute, DOM::Element const& element)
+static inline bool matches_attribute(CSS::Selector::SimpleSelector::Attribute const& attribute, DOM::Element const& element)
{
switch (attribute.match_type) {
case CSS::Selector::SimpleSelector::Attribute::MatchType::HasAttribute:
@@ -52,7 +52,7 @@ static bool matches_attribute(CSS::Selector::SimpleSelector::Attribute const& at
return false;
}
-static bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoClass const& pseudo_class, DOM::Element const& element)
+static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoClass const& pseudo_class, DOM::Element const& element)
{
switch (pseudo_class.type) {
case CSS::Selector::SimpleSelector::PseudoClass::Type::None:
@@ -165,7 +165,7 @@ static bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoClass cons
return false;
}
-static bool matches(CSS::Selector::SimpleSelector const& component, DOM::Element const& element)
+static inline bool matches(CSS::Selector::SimpleSelector const& component, DOM::Element const& element)
{
switch (component.type) {
case CSS::Selector::SimpleSelector::Type::Universal:
@@ -188,7 +188,7 @@ static bool matches(CSS::Selector::SimpleSelector const& component, DOM::Element
}
}
-static bool matches(CSS::Selector const& selector, int component_list_index, DOM::Element const& element)
+static inline bool matches(CSS::Selector const& selector, int component_list_index, DOM::Element const& element)
{
auto& relative_selector = selector.compound_selectors()[component_list_index];
for (auto& simple_selector : relative_selector.simple_selectors) {