Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29559743: Issue 5650 - Apply emulation filters to shadow DOMs

Created:
Sept. 29, 2017, 11:21 p.m. by Manish Jethani
Modified:
June 14, 2018, 5:09 a.m.
CC:
kzar
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Prevent author code from intercepting shadowAttached event #

Total comments: 7

Patch Set 3 : Find shadow roots semi-asynchronously #

Total comments: 4

Patch Set 4 : Remove unused node argument #

Total comments: 11

Patch Set 5 : Terminate loop #

Patch Set 6 : Use Node.contains #

Patch Set 7 : Take event type as a parameter #

Total comments: 4

Patch Set 8 : Optimize removeRedundantNodes based on node order #

Total comments: 6

Patch Set 9 : Run code only on if Shadow DOM is supported #

Total comments: 5

Patch Set 10 : Use pure generator function to extract added subtrees #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -16 lines) Patch
M lib/content/elemHideEmulation.js View 1 2 3 4 5 6 7 8 9 6 chunks +147 lines, -15 lines 0 comments Download
M test/browser/elemHideEmulation.js View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 39
Manish Jethani
Sept. 29, 2017, 11:21 p.m. (2017-09-29 23:21:34 UTC) #1
Manish Jethani
Patch Set 1 For -abp-has and -abp-contains we need to be able to peek into ...
Sept. 29, 2017, 11:31 p.m. (2017-09-29 23:31:30 UTC) #2
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29559744/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29559744/lib/content/elemHideEmulation.js#newcode604 lib/content/elemHideEmulation.js:604: for (let child of node.children) We could use a ...
Sept. 29, 2017, 11:43 p.m. (2017-09-29 23:43:56 UTC) #3
Manish Jethani
Patch Set 2: Prevent author code from intercepting shadowAttached event https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js#newcode308 ...
Sept. 30, 2017, 12:29 p.m. (2017-09-30 12:29:01 UTC) #4
lainverse
https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js#newcode585 lib/content/elemHideEmulation.js:585: event.stopImmediatePropagation(); On 2017/09/30 12:29:01, Manish Jethani wrote: > Prevent ...
Oct. 2, 2017, 2:11 p.m. (2017-10-02 14:11:55 UTC) #5
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js#newcode585 lib/content/elemHideEmulation.js:585: event.stopImmediatePropagation(); On 2017/10/02 14:11:55, lainverse wrote: > On 2017/09/30 ...
Oct. 2, 2017, 2:28 p.m. (2017-10-02 14:28:11 UTC) #6
lainverse
https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js#newcode585 lib/content/elemHideEmulation.js:585: event.stopImmediatePropagation(); On 2017/10/02 14:28:11, Manish Jethani wrote: > On ...
Oct. 2, 2017, 4:05 p.m. (2017-10-02 16:05:39 UTC) #7
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29560555/lib/content/elemHideEmulation.js#newcode585 lib/content/elemHideEmulation.js:585: event.stopImmediatePropagation(); On 2017/10/02 16:05:39, lainverse wrote: > [...] > ...
Oct. 2, 2017, 4:12 p.m. (2017-10-02 16:12:31 UTC) #8
Manish Jethani
I'll file an issue with Chromium to allow extensions to access closed shadow roots. Meanwhile, ...
Oct. 14, 2017, 12:52 a.m. (2017-10-14 00:52:37 UTC) #9
Sebastian Noack
On 2017/10/14 00:52:37, Manish Jethani wrote: > I'll file an issue with Chromium to allow ...
Oct. 17, 2017, 9:44 p.m. (2017-10-17 21:44:16 UTC) #10
hub
This sounds like a good idea.
Oct. 18, 2017, 4:38 p.m. (2017-10-18 16:38:09 UTC) #11
Manish Jethani
Patch Set 3: Find shadow roots semi-asynchronously https://codereview.adblockplus.org/29559743/diff/29582707/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582707/lib/content/elemHideEmulation.js#newcode149 lib/content/elemHideEmulation.js:149: function removeRedundantNodes(nodes) ...
Oct. 18, 2017, 11:08 p.m. (2017-10-18 23:08:00 UTC) #12
Manish Jethani
Patch Set 4: Remove unused node argument
Oct. 18, 2017, 11:09 p.m. (2017-10-18 23:09:04 UTC) #13
Sebastian Noack
https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; Why don't you just keep track ...
Oct. 19, 2017, 12:43 a.m. (2017-10-19 00:43:08 UTC) #14
Manish Jethani
Patch Set 5: Terminate loop https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On ...
Oct. 19, 2017, 2:13 a.m. (2017-10-19 02:13:45 UTC) #15
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On 2017/10/19 02:13:44, Manish Jethani wrote: ...
Oct. 19, 2017, 2:19 a.m. (2017-10-19 02:19:06 UTC) #16
Sebastian Noack
https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On 2017/10/19 02:19:06, Manish Jethani wrote: ...
Oct. 19, 2017, 3:51 a.m. (2017-10-19 03:51:02 UTC) #17
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On 2017/10/19 03:51:01, Sebastian Noack wrote: ...
Oct. 19, 2017, 9:57 a.m. (2017-10-19 09:57:14 UTC) #18
lainverse
Maybe something like this: // parentNode crawler function removeRedundantNodes(nodes) { let link, redundant = []; ...
Oct. 19, 2017, 2:01 p.m. (2017-10-19 14:01:39 UTC) #19
lainverse
// parentNode crawler function removeRedundantNodes(nodes) { let link, redundant = []; for (let node of ...
Oct. 19, 2017, 2:02 p.m. (2017-10-19 14:02:01 UTC) #20
lainverse
// parent.contains(child) when nodes is an Array let removeRedundantNodes = nodes => nodes.filter( node => ...
Oct. 19, 2017, 3:33 p.m. (2017-10-19 15:33:52 UTC) #21
Sebastian Noack
https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On 2017/10/19 09:57:14, Manish Jethani wrote: ...
Oct. 19, 2017, 6:35 p.m. (2017-10-19 18:35:40 UTC) #22
Manish Jethani
Patch Set 6: Use Node.contains https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29582710/lib/content/elemHideEmulation.js#newcode168 lib/content/elemHideEmulation.js:168: nodeInfo.redundant = true; On ...
Oct. 19, 2017, 11:14 p.m. (2017-10-19 23:14:59 UTC) #23
Manish Jethani
Patch Set 7: Take event type as a parameter https://codereview.adblockplus.org/29559743/diff/29583631/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29583631/lib/content/elemHideEmulation.js#newcode348 lib/content/elemHideEmulation.js:348: ...
Oct. 19, 2017, 11:44 p.m. (2017-10-19 23:44:03 UTC) #24
Manish Jethani
Patch Set 8: Optimize removeRedundantNodes based on node order A node always appears before any ...
Oct. 20, 2017, 2:39 p.m. (2017-10-20 14:39:10 UTC) #25
lainverse
https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js#newcode679 lib/content/elemHideEmulation.js:679: if (node instanceof Element) Actually if nodes are always ...
Oct. 20, 2017, 3:37 p.m. (2017-10-20 15:37:08 UTC) #26
hub
https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js#newcode48 lib/content/elemHideEmulation.js:48: let newSelector = node instanceof ShadowRoot ? ":host" : ...
Oct. 20, 2017, 3:37 p.m. (2017-10-20 15:37:57 UTC) #27
Manish Jethani
Patch Set 9: Run code only on if Shadow DOM is supported https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js ...
Oct. 20, 2017, 4:16 p.m. (2017-10-20 16:16:42 UTC) #28
lainverse
https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js#newcode679 lib/content/elemHideEmulation.js:679: if (node instanceof Element) > While it is better ...
Oct. 20, 2017, 5:37 p.m. (2017-10-20 17:37:36 UTC) #29
hub
https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js#newcode679 lib/content/elemHideEmulation.js:679: if (typeof ShadowRoot != "undefined") On 2017/10/20 16:16:42, Manish ...
Oct. 20, 2017, 7:12 p.m. (2017-10-20 19:12:51 UTC) #30
Manish Jethani
Patch Set 10: Use pure generator function to extract added subtrees https://codereview.adblockplus.org/29559743/diff/29584630/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): ...
Oct. 22, 2017, 8:01 p.m. (2017-10-22 20:01:35 UTC) #31
hub
https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js#newcode679 lib/content/elemHideEmulation.js:679: if (typeof ShadowRoot != "undefined") On 2017/10/22 20:01:35, Manish ...
Oct. 23, 2017, 1:30 p.m. (2017-10-23 13:30:34 UTC) #32
Manish Jethani
https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js File lib/content/elemHideEmulation.js (right): https://codereview.adblockplus.org/29559743/diff/29584695/lib/content/elemHideEmulation.js#newcode679 lib/content/elemHideEmulation.js:679: if (typeof ShadowRoot != "undefined") On 2017/10/23 13:30:34, hub ...
Oct. 23, 2017, 11:04 p.m. (2017-10-23 23:04:29 UTC) #33
Manish Jethani
On 2017/10/14 00:52:37, Manish Jethani wrote: > I'll file an issue with Chromium to allow ...
Oct. 26, 2017, 10:07 p.m. (2017-10-26 22:07:03 UTC) #34
Manish Jethani
On 2017/10/26 22:07:03, Manish Jethani wrote: > On 2017/10/14 00:52:37, Manish Jethani wrote: > > ...
Feb. 2, 2018, 3:23 p.m. (2018-02-02 15:23:02 UTC) #35
Manish Jethani
On 2018/02/02 15:23:02, Manish Jethani wrote: > On 2017/10/26 22:07:03, Manish Jethani wrote: > > ...
Feb. 5, 2018, 5:06 p.m. (2018-02-05 17:06:40 UTC) #36
Manish Jethani
Shall we go ahead with this change, at least for open shadow DOMs? I don't ...
June 12, 2018, 9:06 a.m. (2018-06-12 09:06:22 UTC) #37
hub
I would have liked to see a proper test for this case.
June 14, 2018, 3:17 a.m. (2018-06-14 03:17:39 UTC) #38
Manish Jethani
June 14, 2018, 5:09 a.m. (2018-06-14 05:09:07 UTC) #39
On 2018/06/14 03:17:39, hub wrote:
> I would have liked to see a proper test for this case.

I'll add one, thanks.

Powered by Google App Engine
This is Rietveld