Opened on 05/16/2017 at 01:28:58 PM
Closed on 07/02/2017 at 12:01:01 PM
#5249 closed change (fixed)
Implement :-abp-contains() pseudo class for element hiding emulation
Reported by: | hfiguiere | Assignee: | hfiguiere |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Core | Keywords: | |
Cc: | fhd, trev, mapx, greiner | Blocked By: | #3143 |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by trev)
Background
After issue #3143 where we implement an equivalent of the :has() pseudo-class, we should implement an equivalent of the :contains() pseudo-class as well. While this one isn't part of the CSS4 standard (merely being referenced as a feature implemented by the JSONSelect library), this functionality sees to be useful to filter list authors and other ad blockers have a comparable feature already.
What to change
On top of the patch for issue #3143, add support for :-abp-contains() pseudo-class looking for substring matches within the text content of a node.
Attachments (0)
Change History (9)
comment:1 Changed on 05/16/2017 at 01:29:32 PM by hfiguiere
- Cc fhd trev added
comment:2 Changed on 05/17/2017 at 06:26:33 AM by mapx
- Cc mapx added
comment:3 Changed on 05/17/2017 at 06:31:09 AM by mapx
comment:4 Changed on 05/17/2017 at 10:53:47 AM by trev
- Description modified (diff)
Custom CSS additions are supposed to have a vendor prefix. At some point, browsers will implement :has() natively and it would be naive to assume that their implementation will be compatible to the one we created. Similarly, :contains() might be added to the CSS specification at some point but it is very unlikely that the CSS working group will specify the same behavior as what we plan to implement now. And - no, it's unlikely that our implementation will be fully compatible to uBlock's, with all the shortcuts that they tend to take.
comment:5 Changed on 05/17/2017 at 10:55:29 AM by trev
- Summary changed from Implement :has-text() pseudo class to Implement :-abp-contains() pseudo class for element hiding emulation
comment:6 Changed on 05/25/2017 at 01:03:39 PM by hfiguiere
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:7 Changed on 05/26/2017 at 12:34:49 PM by greiner
- Cc greiner added
comment:8 Changed on 07/02/2017 at 11:58:30 AM by abpbot
A commit referencing this issue has landed:
Issue 5249 - Implement :-abp-contains()
comment:9 Changed on 07/02/2017 at 12:01:01 PM by hfiguiere
- Resolution set to fixed
- Status changed from reviewing to closed
Why :abp-has and :abp-has-text and not simply :has , :has-text like in the reference link about "Procedural cosmetic filters" ?