mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Updated: ":upward() vs :has()" (2)
parent
e41db654a2
commit
601a9eefc3
1 changed files with 1 additions and 1 deletions
|
|
@ -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 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()`.
|
||||
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()`. Using `#?#` (instead of `##` for a procedural cosmetic filter will prevent uBO from trying to convert the filter into a declarative one.
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue