From 23b64f06d2cfa1c849c1c7b09638af6cbc3bad98 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 16 Dec 2018 11:07:37 -0500 Subject: [PATCH] Updated Procedural cosmetic filters (markdown) --- Procedural-cosmetic-filters.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Procedural-cosmetic-filters.md b/Procedural-cosmetic-filters.md index d41f9e9..cd41316 100644 --- a/Procedural-cosmetic-filters.md +++ b/Procedural-cosmetic-filters.md @@ -49,13 +49,7 @@ Deprecated in favor of [`:has(...)`](#subjecthasarg) in uBO 1.15.0 ### `subject:if-not(arg)` -Essentially the same as the [`:has(...)`](#subjecthasarg) operator, except that the element _subject_ is selected if and only if the result of evaluating _arg_ is exactly zero elements. - -### `subject:not(arg)` - -Introduced in uBO 1.17.5b9 - -Increases compatibility. Can be used to negate procedural selectors (for example `:not(:has(...))` is equivalent of `:if-not(...)` +Deprecated in favor of [`:not(:has(arg))`](#subjectnotarg) operator. ### `subject:matches-css(arg)` @@ -77,6 +71,20 @@ Same as `:matches-css(...)`, except that the style will be looked-up for the `:b Same as `:matches-css(...)` except that the style will be looked-up for `:after` pseudo-class of the _subject_ element. +### `subject:not(arg)` + +- Description: Select element _subject_ if and only if the result of evaluating _arg_ is exactly zero elements. +- Chainable: Yes. +- _subject_: Can be a plain CSS selector, or a procedural cosmetic filter. +- _arg_: A procedural cosmetic filter, which is evaluated in the context of the _subject_ element. + +Introduced in uBO 1.17.5b9 to increase compatibility with AdGuard filter syntax. + +Use to negate other procedural selectors. For example `:not(:has(.foo))` will match if there are no descendant matching `.foo`. + +Note that if _arg_ valid CSS selector, uBO will not consider the `:not` operator to be a procedural one, it will rather consider the operator as being part of a CSS selector. Thus this ensure compatibility with the existing +[CSS `:not(...)` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:not). + ### `subject:xpath(arg)` - Description: Create a new set of elements by evaluating a XPath using _subject_ as the context node (optional) and _arg_ as the expression.