Bug 1528762. Don't inject customElements.js into system-principal about:blank. r=bgrins
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 22 Feb 2019 21:32:09 +0000
changeset 518540 1033b5aecacc6e1ceae8a30639ff7b20cd322479
parent 518539 4978133d62260c9405d07d049e01bda746dee9af
child 518541 e657fe2ca2a3d8fe935d3ea7308938b40f94a17c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1528762
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528762. Don't inject customElements.js into system-principal about:blank. r=bgrins Otherwise we get a performance regression on tp5o responsiveness and tp5o_webext responsiveness when about:blank starts firing document-element-inserted notifications. Differential Revision: https://phabricator.services.mozilla.com/D20873
toolkit/components/processsingleton/CustomElementsListener.jsm
--- a/toolkit/components/processsingleton/CustomElementsListener.jsm
+++ b/toolkit/components/processsingleton/CustomElementsListener.jsm
@@ -10,14 +10,18 @@ const {Services} = ChromeUtils.import("r
 // Any window-specific elements can be registered via <script> tags at the
 // top of individual documents.
 Services.obs.addObserver({
   observe(doc) {
     if (doc.nodePrincipal.isSystemPrincipal && (
       doc.contentType == "application/vnd.mozilla.xul+xml" ||
       doc.contentType == "application/xhtml+xml" ||
       doc.contentType == "text/html"
-    )) {
+    ) &&
+        // People shouldn't be using our built-in custom elements in
+        // system-principal about:blank anyway, and trying to support that
+        // causes responsiveness regressions.  So let's not support it.
+        doc.URL != "about:blank") {
       Services.scriptloader.loadSubScript(
         "chrome://global/content/customElements.js", doc.ownerGlobal);
     }
   },
 }, "document-element-inserted");