Opened on 03/03/2018 at 02:01:49 PM

Closed on 03/09/2018 at 01:11:46 AM

Last modified on 03/16/2018 at 12:34:45 PM

#6441 closed defect (fixed)

Enabled dom.webcomponents & ABP results in blank Firefox screens

Reported by: feng Assignee: mjethani
Priority: P2 Milestone: Adblock-Plus-3.0.3-for-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: kzar, sebastian, mjethani, hfiguiere, mapx Blocked By:
Blocking: #6459 Platform: Firefox
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

Description (last modified by mapx)


OS: Win 10 Pro 64bit Version: 1709 Build: 10.0.16299.248
Browser: Firefox 58.0.2 (64-Bit)
Adblock Plus 3.0.2
Filter: EasyList Germany+EasyList

How to reproduce

  1. Enable web components support via about:config and set dom.webcomponents.enabled and dom.webcomponents.customelements.enabled to "true"
  1. Make sure ABP is enabled as well.
  1. Visit i.e. The page gets loaded but is not visible.
  1. Retry step 3 with any webpages you want.

Observed behaviour

The webpages are invisible (blank). This only happens when webcomponents support and ABP are enabled. As soon as I disable ABP I can hit the refresh button on an invisible page and it gets shown.
The same happens if I start browsing without ABP. When I enable ABP in the addon tab, the other tabs which showed content before become suddenly blank.

Expected behaviour

ABP and web components shouldn't conflict :)

Attachments (0)

Change History (16)

comment:1 Changed on 03/03/2018 at 05:23:13 PM by mapx

I get the blank page when dom.webcomponents.shadowdom.enabled is true

Last edited on 03/03/2018 at 09:11:25 PM by mapx

comment:2 Changed on 03/03/2018 at 05:23:57 PM by mapx

  • Cc kzar sebastian mjethani hfiguiere added

comment:3 Changed on 03/03/2018 at 09:12:20 PM by mapx

  • Description modified (diff)

comment:4 Changed on 03/03/2018 at 09:13:07 PM by mapx

  • Cc mapx added

comment:5 Changed on 03/05/2018 at 09:52:54 AM by mjethani

I haven't looked into the actual reason why this is happening, but in any case our use of Shadow DOM v0 is only meant for older browsers that do not support user style sheets. We can create the shadow DOM lazily here to avoid this issue entirely. I have uploaded a patch for this.

comment:6 Changed on 03/05/2018 at 09:53:21 AM by mjethani

  • Review URL(s) modified (diff)

comment:7 Changed on 03/05/2018 at 12:44:59 PM by mjethani

Alright, so Firefox does not support <shadow> anymore. We have to use <content> instead. I'll update the patch.

comment:8 Changed on 03/08/2018 at 03:12:03 PM by mjethani

  • Owner set to mjethani

comment:9 Changed on 03/08/2018 at 06:53:43 PM by sebastian

Once Chrome 66 becomes stable, we should remove any use of Shadow DOM v0. At that time, it will only be leveraged in rare cases (i.e. when using an outdated version of Chrome or for particular element hiding emulation filters), while a shadow root is still created for each document. Simply falling back to a stylesheet in the light DOM should be good enough in these scenarios. Also considering that Chromium will drop support for Shadow DOM v0, now where user style sheets are supported.

Last edited on 03/08/2018 at 07:01:16 PM by sebastian

comment:10 Changed on 03/08/2018 at 07:20:11 PM by sebastian

Or perhaps a better idea would be to check navigator.userAgent and only create the shadow root for Chromium <66. (Yeah, checking the user agent string is generally a bad idea, but unfortunately feature detection isn't possible here.) That way we can already stop creating an unnecessary shadow root, now, on browsers that support user style sheets, and leave shadow DOM support around for older Chromium versions for an extended period.

comment:11 Changed on 03/09/2018 at 12:53:49 AM by sebastian

  • Priority changed from Unknown to P2
  • Ready set

comment:12 Changed on 03/09/2018 at 01:08:53 AM by abpbot

A commit referencing this issue has landed:
Issue 6441 - Avoid unnecessary shadow root

comment:13 Changed on 03/09/2018 at 01:11:46 AM by mjethani

  • Component changed from Unknown to Platform
  • Milestone set to Adblock-Plus-3.0.3-for-Chrome-Opera-Firefox
  • Resolution set to fixed
  • Status changed from new to closed

comment:14 Changed on 03/09/2018 at 01:44:47 PM by mjethani

  • Blocking 6459 added

comment:15 Changed on 03/16/2018 at 12:34:03 PM by Ross

Fixed. Can no longer reproduce blank screen as described and shadow root is still created in Chrome < 66 (and Opera where Chrome < 66).

Firefox 53 / Firefox 58 / Windows 7
Chrome 49 / 65 / Windows 7
Opera 36 / 51 / Windows 7

comment:16 Changed on 03/16/2018 at 12:34:45 PM by Ross

  • Verified working set

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from mjethani.
Note: See TracTickets for help on using tickets.