Bug 1538509 - [de-xbl] remove the overlayTrigger binding. r=darktrojan
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sat, 23 Mar 2019 22:13:30 +0200
changeset 35742 44e0b7bccc36e2fbea92430028eb2e57faca7099
parent 35741 5d14d6540a92fba46b3aa40959baae535a5eedac
child 35743 1579379c18bb86f01a8ed6cae1a99b0f79aa6c57
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersdarktrojan
bugs1538509
Bug 1538509 - [de-xbl] remove the overlayTrigger binding. r=darktrojan
common/content/overlayBindings.css
common/content/overlayBindings.xml
common/jar.mn
common/moz.build
common/src/Overlays.jsm
deleted file mode 100644
--- a/common/content/overlayBindings.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-overlayTrigger {
-  -moz-binding: url("chrome://messenger/content/overlayBindings.xml#overlayTrigger");
-}
deleted file mode 100644
--- a/common/content/overlayBindings.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<bindings id="overlay-bindings" xmlns="http://www.mozilla.org/xbl">
-  <binding id="overlayTrigger">
-    <implementation>
-      <constructor><![CDATA[
-          this.dispatchEvent(new CustomEvent("bindingattached", { bubbles: false }));
-      ]]></constructor>
-    </implementation>
-  </binding>
-</bindings>
deleted file mode 100644
--- a/common/jar.mn
+++ /dev/null
@@ -1,3 +0,0 @@
-messenger.jar:
-    content/messenger/overlayBindings.css (content/overlayBindings.css)
-    content/messenger/overlayBindings.xml (content/overlayBindings.xml)
--- a/common/moz.build
+++ b/common/moz.build
@@ -4,13 +4,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += [
     'public',
     'src',
     'saxparser'
 ]
 
-JAR_MANIFESTS += ['jar.mn']
-
 XPCSHELL_TESTS_MANIFESTS += [
     'test/xpcshell/xpcshell.ini',
 ]
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -191,47 +191,33 @@ class Overlays {
 
     // We've resolved all the forward references we can, we can now go ahead and load the scripts
     let deferredLoad = [];
     for (let script of unloadedScripts) {
       deferredLoad.push(...this.loadScript(script));
     }
 
     if (this.document.readyState == "complete") {
-      let sheet;
-      let overlayTrigger = this.document.createXULElement("overlayTrigger");
-      overlayTrigger.addEventListener("bindingattached", () => {
-        oconsole.debug("XBL binding attached, continuing with load");
-        if (sheet) {
-          sheet.remove();
-        }
-        overlayTrigger.remove();
-
-        setTimeout(() => {
-          this._finish();
+      setTimeout(() => {
+        this._finish();
 
-          // Now execute load handlers since we are done loading scripts
-          let bubbles = [];
-          for (let { listener, useCapture } of deferredLoad) {
-            if (useCapture) {
-              this._fireEventListener(listener);
-            } else {
-              bubbles.push(listener);
-            }
+        // Now execute load handlers since we are done loading scripts
+        let bubbles = [];
+        for (let { listener, useCapture } of deferredLoad) {
+          if (useCapture) {
+            this._fireEventListener(listener);
+          } else {
+            bubbles.push(listener);
           }
+        }
 
-          for (let listener of bubbles) {
-            this._fireEventListener(listener);
-          }
-        }, 0);
-      }, { once: true });
-      this.document.documentElement.appendChild(overlayTrigger);
-      if (overlayTrigger.parentNode) {
-        sheet = this.loadCSS("chrome://messenger/content/overlayBindings.css");
-      }
+        for (let listener of bubbles) {
+          this._fireEventListener(listener);
+        }
+      });
     } else {
       this.document.defaultView.addEventListener("load", this._finish.bind(this), { once: true });
     }
   }
 
   _finish() {
     for (let [deck, selectedIndex] of this._decksToResolve.entries()) {
       deck.setAttribute("selectedIndex", selectedIndex);