Opened on 02/26/2018 at 12:43:18 PM
Closed on 03/16/2019 at 03:45:55 PM
#6422 closed change (rejected)
Use user style sheets for emulation hiding filters if available
Reported by: | mjethani | Assignee: | mjethani |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Platform | Keywords: | circumvention |
Cc: | kzar, hfiguiere, sebastian, fhd, amrmak, arthur | Blocked By: | #6437, #6446, #6458, #6504 |
Blocking: | #6459 | Platform: | Unknown / Cross platform |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Background
Currently ABP uses user style sheets only for standard hiding filters, but there have been recent changes that enable us to use them for emulation hiding filters as well:
- Now we keep the style sheet for emulation hiding filters updated at all times so that there are no stale selectors (revision 8399e34fff05)
- If both tabs.insertCSS and tabs.removeCSS are available, we use user style sheets for some (but not all, i.e. only -abp-properties) emulation hiding filters (revision 7247eb4632fa)
With a little bit of work, we can start using user style sheets for -abp-has and -abp-contains as well.
What to change
In include.preload.js, set the useInlineStyles property on the ElemHideEmulation instance to false if user style sheets are fully supported, otherwise set it to true.
Resolution
See #6504. We no longer use style sheets for any element hiding emulation filters (not even :-abp-properties()).
Attachments (0)
Change History (19)
comment:2 Changed on 03/02/2018 at 01:55:56 PM by mjethani
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:3 Changed on 03/05/2018 at 01:31:01 PM by mjethani
- Keywords circumvention added
- Review URL(s) modified (diff)
comment:4 in reply to: ↑ 1 Changed on 03/05/2018 at 06:20:19 PM by mjethani
comment:5 Changed on 03/05/2018 at 09:58:22 PM by mjethani
- Blocked By 6446 added
comment:6 Changed on 03/07/2018 at 04:28:01 PM by mjethani
- Blocked By 6437 added
comment:7 Changed on 03/07/2018 at 07:58:06 PM by abpbot
A commit referencing this issue has landed:
Issue 6422 - Prefer CSS selectors for -abp-has and -abp-contains
comment:8 Changed on 03/07/2018 at 07:58:26 PM by sebastian
- Priority changed from Unknown to P3
- Ready set
comment:9 Changed on 03/08/2018 at 06:50:15 PM by amrmak
- Cc amrmak added
comment:10 Changed on 03/08/2018 at 10:41:42 PM by mjethani
- Blocked By 6458 added
comment:11 Changed on 03/09/2018 at 02:51:50 AM by abpbot
A commit referencing this issue has landed:
Issue 6422 - Prefer CSS selectors for -abp-has and -abp-contains
comment:12 Changed on 03/09/2018 at 01:38:35 PM by mjethani
- Blocked By 6459 added
comment:13 Changed on 03/09/2018 at 01:40:07 PM by mjethani
- Blocked By 6459 removed
- Blocking 6459 added
comment:14 Changed on 03/20/2018 at 11:11:36 AM by mjethani
comment:15 Changed on 03/20/2018 at 11:15:19 AM by mjethani
- Blocked By 6504 added
comment:16 Changed on 04/23/2018 at 02:37:53 PM by arthur
- Cc arthur added
comment:17 Changed on 03/16/2019 at 03:44:48 PM by mjethani
- Description modified (diff)
- Resolution set to fixed
- Status changed from reviewing to closed
comment:18 Changed on 03/16/2019 at 03:45:37 PM by mjethani
- Resolution fixed deleted
- Status changed from closed to reopened
comment:19 Changed on 03/16/2019 at 03:45:55 PM by mjethani
- Resolution set to rejected
- Status changed from reopened to closed
Actually we don't have to traverse the entire DOM every time there's a mutation just for -abp-has and -abp-contains.
Let's take this document:
And let's say we have the selector :-abp-contains(Hello)
Now suppose a new node n2_3 is added to the DOM. In that case, we only need to do the following:
In this case, the path of n2_4 would have to be updated.
We don't need to go into n1, n3, and n4 because nothing has changed over there.
It's the same for when a node is deleted, except that any selectors that directly applied to the node or any of its descendants must be removed.
To recalculate and update the paths of the affected nodes, we'll have to maintain weak references to those nodes along with their previously calculated paths.
(Reposted from a previous email discussion.)