Bug 1486845 - Remove unused eventNode handling in tabbox. r=enn
☠☠ backed out by 6c83f735355d ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Wed, 29 Aug 2018 12:38:05 +0200
changeset 482667 ef8c5c529210fb992f4bff90fb26a4989743aeb8
parent 482666 9cbc8592d649c3876156e78fb9539038913435e6
child 482668 f292ef31ef0b6a82cdc3fafadef111fbd97b964d
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersenn
bugs1486845
milestone63.0a1
Bug 1486845 - Remove unused eventNode handling in tabbox. r=enn
browser/base/content/browser.xul
toolkit/content/widgets/tabbox.js
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -1265,17 +1265,17 @@ xmlns="http://www.w3.org/1999/xhtml"
         <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true" disablefullscreen="true"
                   style="min-width: 14em; width: 18em; max-width: 36em;" tooltip="aHTMLTooltip"/>
       </vbox>
 
       <splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
       <vbox id="appcontent" flex="1">
         <notificationbox id="high-priority-global-notificationbox" notificationside="top"/>
         <tabbox id="tabbrowser-tabbox"
-                flex="1" eventnode="document" tabcontainer="tabbrowser-tabs">
+                flex="1" tabcontainer="tabbrowser-tabs">
           <tabpanels id="tabbrowser-tabpanels"
                      flex="1" class="plain" selectedIndex="0"/>
         </tabbox>
       </vbox>
       <vbox id="browser-border-end" hidden="true" layer="true"/>
     </hbox>
 #include ../../components/customizableui/content/customizeMode.inc.xul
   </deck>
--- a/toolkit/content/widgets/tabbox.js
+++ b/toolkit/content/widgets/tabbox.js
@@ -9,37 +9,23 @@
 class MozTabbox extends MozXULElement {
   constructor() {
     super();
     this._handleMetaAltArrows = /Mac/.test(navigator.platform);
     this.disconnectedCallback = this.disconnectedCallback.bind(this);
   }
 
   connectedCallback() {
-    switch (this.getAttribute("eventnode")) {
-      case "parent":
-        this._eventNode = this.parentNode;
-        break;
-      case "window":
-        this._eventNode = window;
-        break;
-      case "document":
-        this._eventNode = document;
-        break;
-      default:
-        this._eventNode = this;
-    }
-
-    Services.els.addSystemEventListener(this._eventNode, "keydown", this, false);
+    Services.els.addSystemEventListener(document, "keydown", this, false);
     window.addEventListener("unload", this.disconnectedCallback, { once: true });
   }
 
   disconnectedCallback() {
     window.removeEventListener("unload", this.disconnectedCallback);
-    Services.els.removeSystemEventListener(this._eventNode, "keydown", this, false);
+    Services.els.removeSystemEventListener(document, "keydown", this, false);
   }
 
   set handleCtrlTab(val) {
     this.setAttribute("handleCtrlTab", val);
     return val;
   }
 
   get handleCtrlTab() {
@@ -108,29 +94,16 @@ class MozTabbox extends MozXULElement {
     return val;
   }
 
   get selectedPanel() {
     var tabpanels = this.tabpanels;
     return tabpanels && tabpanels.selectedPanel;
   }
 
-  set eventNode(val) {
-    if (val != this._eventNode) {
-      Services.els.addSystemEventListener(val, "keydown", this, false);
-      Services.els.removeSystemEventListener(this._eventNode, "keydown", this, false);
-      this._eventNode = val;
-    }
-    return val;
-  }
-
-  get eventNode() {
-    return this._eventNode;
-  }
-
   handleEvent(event) {
     if (!event.isTrusted) {
       // Don't let untrusted events mess with tabs.
       return;
     }
 
     // Don't check if the event was already consumed because tab
     // navigation should always work for better user experience.