From 19b2127cce722219451febe49ebbcf0da3c58f62 Mon Sep 17 00:00:00 2001 From: garry-ut99 <72945564+garry-ut99@users.noreply.github.com> Date: Sun, 27 Oct 2024 17:45:58 +0000 Subject: [PATCH] Updated: ":upward() vs :has()" --- Filter-Performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Filter-Performance.md b/Filter-Performance.md index 8eeb3b7..16624d1 100644 --- a/Filter-Performance.md +++ b/Filter-Performance.md @@ -10,7 +10,7 @@ See: - https://reddit.com/r/uBlockOrigin/comments/wxdyfn/comment/ilqyveu/ - https://reddit.com/r/uBlockOrigin/comments/j4ewg7/comment/g7imasx/ -Keep in mind that Chromium now supports `:has()` natively (soon to be enabled by default on Firefox too), so native `:has()` should be more efficient than `:upward()` which needs to Javascript code to function. +Keep in mind that all major browsers now supports `:has()` natively, so native `:has()` should be more efficient than `:upward()` and procedural `:has()`, which need Javascript code to function. When using `:has()` uBlock will automatically switch to native `:has()` if it's available in browser, if it's unavailable uBlock will fallback to a procedural `:has()`. Sometimes using `:upward()` instead of `:has()` _might_ be more performant. `:upward()` is fast, it just lookup ancestors -- there is only one parent per element, `:has()` has to lookup descendants, there can be many children per elements.