Changes between Version 24 and Version 32 of Ticket #3143


Ignore:
Timestamp:
05/31/2017 03:49:36 PM (22 months ago)
Author:
trev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3143

    • Property Status changed from new to reviewing
    • Property Cc sergz oleksandr added
    • Property Blocked By changed from 4394, 4726, 4962 to 4394, 4726, 4796, 4962
    • Property Ready set
    • Property Owner changed from fhd to hfiguiere
    • Property Blocking changed from 2360 to 2360, 5094, 5249
  • Ticket #3143 – Description

    v24 v32  
    1111 
    1212=== What to change === 
    13 - Allow `:has()` to be specified within element hiding filter CSS selectors 
    14 - Determine whether `:has()` pseudo-selector is supported natively (`document.querySelector("abp:has(abp)")` throws a syntax error exception if `:has()` is not supported) 
    15 - Otherwise detect the pattern `PREFIX:has(SELECTOR)SUFFIX` inside the selector string and run the following logic upon encountering it: 
    16   - Extract selectors from selector string because it might contain multiple separate selectors 
    17   - For each element `a` matching `PREFIX` in selector 
    18     - Check whether `SELECTOR` matches any of `a`'s child elements 
    19     - If so, hide all elements matching `SUFFIX` inside `a` or `a` if `SUFFIX` does not exist 
    20 - Make sure `:has()` and `-abp-properties` works in conjunction 
     13- Introduce a new syntax specifically for element hiding emulation filters: 
     14 {{{ 
     15example.com#?#foo :-abp-properties(background-color:#fff) bar 
     16}}} 
     17 Note `#?#` instead of `##` indicating that this isn't a regular element hiding filter but that the selector is rather being evaluated by Adblock Plus and some additional pseudo-classes are allowed. 
     18- Make `filterClasses` module translate legacy filters like `example.com##foo [-abp-properties="background-color:#fff"] bar` into `example.com#?#foo :-abp-properties(background-color:#fff) bar` "on the fly." The list should show the modified filter so that people stop using the legacy syntax ASAP. It's probably best to modify `Filter.fromText()` for that (otherwise `Filter.fromText()` might cache two copies of the same filter). 
     19- Special pseudo-classes to be supported are `:-abp-properties(...)` and `:-abp-has(...)`. The latter should allow nesting pseudo-classes, in particular `:-abp-has(:-abp-properties(...))` should be possible. Filters without any special pseudo-classes should be ignored, to make sure that users don't use element hiding emulation filters where regular emulate hiding would do. 
     20- `ElemHideEmulation` class should get a new `removeElements` callback, to be called for any elements selected by filters with `:-abp-has()` pseudo-class. Filters only using `:-abp-properties()` should use `addSelectors` callback as before. 
    2121 
    2222=== Optional changes === 
    23 - Recursively resolve further instances of `:has()` inside `SELECTOR` and `SUFFIX` using the same logic (e.g. to resolve `abc:has(def:has(ghi):has(jkl)) mno:has(pqr)`) 
     23- Allow `:-abp-has()` pseudo-classes to be nested. 
    2424- Observe DOM changes to apply filters to dynamically added/modified elements 
    2525