Changes between Initial Version and Version 3 of Ticket #2360


Ignore:
Timestamp:
09/30/2015 11:49:28 AM (4 years ago)
Author:
greiner
Comment:

Split this ticket up into one for XPath support (#3142) and one for the CSS4 polyfill (#3143).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2360

    • Property Tester changed from to Unknown
    • Property Cc mapx greiner sebastian added
    • Property Component changed from Unknown to Core
    • Property Blocked By changed from to 3142, 3143
    • Property Summary changed from Support XPath or at least :has() pseudo-selector to hide parent by it's child to [meta] Add ability to hide elements by their child elements
    • Property Keywords meta filtersyntax added
  • Ticket #2360 – Description

    initial v3  
    11=== Background === 
    2 Sometimes it is not possible to properly hide advertisement block because it barely has any difference from the rest of the blocks on the page. It could be a paid post with advertisement link in the blog or ads in the search results (like ads on Yandex which were impossible to hide with adblock for a while and recently became hideable simply by mistake). The general problem is the same since there is no way to target that block. It's only possible to hide something inside of it and often that is far from being enough to even get rid of the advertisement. 
     2Sometimes it is not possible to properly hide an ad unit because they are (almost) indistinguishable from similar organic content on the page. For example, it could be a paid post with advertisement link in the blog or ads in the search results (like ads on Yandex which were impossible to hide with adblock for a while and recently became selectable again simply by mistake). The general problem is the same since there is no way to target that block. It's only possible to hide something inside of it and often that is far from being enough to even get rid of the advertisement. 
    33 
    4 === What to change === 
    5 There are two general propositions and actually one doesn't exclude another. So, both could be implemented. 
     4There are two proposals and one doesn't necessarily exclude another so both could be implemented. 
    65 
    7 1. Add support for XPath as it's suggested here: https://adblockplus.org/forum/viewtopic.php?f=4&t=21209 
    8  
    9 In general XPath seems like a generic solution for various problems but XPath filters will have a negative impact on the performance due to the necessity to modify a code of the page and it isn't clear how to monitor dynamic changes to apply such filter to dynamically added or modified page elements. 
    10  
    11 2. Add support for the future CSS4 pseudo-selector :has() http://dev.w3.org/csswg/selectors-4/#relational 
    12  
    13 This solution is less generic and addresses only this particular problem of blocking parent nodes by the child nodes. Also, it doesn't allow to search by content - only by nodes themselves and their specific parameters. Yet it's based on existing CSS functionality, so it will be possible to bind observer to the document to check for new parent nodes and bind another observer object to them to check for changes within only these particular nodes in case specific child node will be added. With time in a new versions of the browsers, it will be possible to completely disable such functionality due to native support of CSS4 selectors. BTW, it's possible to look at jQuery sources for this functionality since they supported :has() pseudo-selector in their selectors way before it was even added into CSS4 drafts. 
    14  
    15 Downside: seems like both propositions will be impossible to implement on platforms which didn't support browser extensions like Android app. 
     61. Add support for XPath (see #3142) 
     72. Add support for the proposed CSS4 pseudo-selector `:has()` (see #3143)