Changes between Version 3 and Version 5 of Ticket #4450


Ignore:
Timestamp:
10/06/2016 09:53:45 AM (3 years ago)
Author:
kzar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4450

    • Property Status changed from reviewing to closed
    • Property Resolution changed from to fixed
    • Property Summary changed from Prevent filters from being created with an empty domain restriction to Prevent ElemHide filters from being created with an empty domain restriction
    • Property Ready set
  • Ticket #4450 – Description

    v3 v5  
    11=== Background === 
    2 Filters can optionally be restricted to a domain, for example `example.com##selector`. They can even be restricted to multiple domains for example `example.com,anotherexample.com##selector`. 
     2Element hiding filters can optionally be restricted to a domain, for example `example.com##selector`. They can even be restricted to multiple domains for example `example.com,anotherexample.com##selector`. 
    33 
    4 Currently filters can be restricted to an empty string domain too, empty domains are simply ignored. For example `,##selector`.  [https://hg.adblockplus.org/adblockpluscore/rev/6a002ff7ffea Until recently] this functionality was broken for filters with only empty domains like that example. We now want to explicitly prevent filters from being created with empty domain restrictions. 
     4Currently filters can be restricted to an empty string domain too, empty domains are simply ignored. Meaning there can be multiple different filters which apply the same selector to all domains unconditionally, which makes the elemHide logic and data structures more complex. 
    55 
    66=== What to change === 
    7 Modify `lib/filterClasses.js` so that if a filter is created with any empty string domain restrictions it results in an `InvalidFilter` instance. Some examples of bad filters that should now result in `InvalidFilter`: 
     7Modify `lib/filterClasses.js` so that if an element hiding filter is created with any empty string domain restrictions it results in an `InvalidFilter` instance. Some examples of bad filters that should now result in `InvalidFilter`: 
    88 
    99 - `,##selector` 
    1010 - `,,,##selector` 
    11  - `||example.com$domains=,,` 
    1211 - `~,example.com##selector` 
     12 
     13Simplify `lib/elemHide.js` so that `filterKeysBySelector` becomes `filterKeyBySelector`.