mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Use fast CSS selector matching in default matches() code path
Before this change, checking if fast selector matching could be used was only enabled in style recalculation and hover invalidation. With this change it's enabled for all callers of SelectorEngine::matches() by default. This way APIs like `Element.matches()` and `querySelector()` could take advantage of this optimization.
This commit is contained in:
parent
17c0d4469c
commit
0f17ad9ebc
Notes:
github-actions[bot]
2025-02-03 09:29:08 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 0f17ad9ebc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3431
Reviewed-by: https://github.com/gmta ✅
7 changed files with 59 additions and 66 deletions
|
@ -25,9 +25,4 @@ struct MatchContext {
|
|||
|
||||
bool matches(CSS::Selector const&, DOM::Element const&, GC::Ptr<DOM::Element const> shadow_host, MatchContext& context, Optional<CSS::Selector::PseudoElement::Type> = {}, GC::Ptr<DOM::ParentNode const> scope = {}, SelectorKind selector_kind = SelectorKind::Normal, GC::Ptr<DOM::Element const> anchor = nullptr);
|
||||
|
||||
[[nodiscard]] bool fast_matches(CSS::Selector const&, DOM::Element const&, GC::Ptr<DOM::Element const> shadow_host, MatchContext& context);
|
||||
[[nodiscard]] bool can_use_fast_matches(CSS::Selector const&);
|
||||
|
||||
[[nodiscard]] bool matches_hover_pseudo_class(DOM::Element const&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue