LibWeb: Mark should_reject_with_ancestor_filter() as inline

This commit is contained in:
Aliaksandr Kalenik 2025-02-19 20:14:00 +01:00 committed by Andreas Kling
parent 0f8050f0bd
commit 0f3665e64e
Notes: github-actions[bot] 2025-02-19 20:53:28 +00:00
2 changed files with 12 additions and 11 deletions

View file

@ -420,16 +420,6 @@ StyleComputer::RuleCache const* StyleComputer::rule_cache_for_cascade_origin(Cas
return true;
}
bool StyleComputer::should_reject_with_ancestor_filter(Selector const& selector) const
{
for (u32 hash : selector.ancestor_hashes()) {
if (hash == 0)
break;
if (!m_ancestor_filter.may_contain(hash))
return true;
}
return false;
}
Vector<MatchingRule> const& StyleComputer::get_hover_rules() const
{
build_rule_cache_if_needed();

View file

@ -186,7 +186,7 @@ public:
void absolutize_values(ComputedProperties&) const;
void compute_font(ComputedProperties&, DOM::Element const*, Optional<CSS::Selector::PseudoElement::Type>) const;
[[nodiscard]] bool should_reject_with_ancestor_filter(Selector const&) const;
[[nodiscard]] inline bool should_reject_with_ancestor_filter(Selector const&) const;
private:
enum class ComputeStyleMode {
@ -338,4 +338,15 @@ private:
Function<void()> m_on_fail;
};
inline bool StyleComputer::should_reject_with_ancestor_filter(Selector const& selector) const
{
for (u32 hash : selector.ancestor_hashes()) {
if (hash == 0)
break;
if (!m_ancestor_filter.may_contain(hash))
return true;
}
return false;
}
}