Bug 1730392 - Port |Bug 596371 - Put <browser> in a <stack> so it's easy to overlay| to SeaMonkey. r=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 12 Sep 2021 10:31:42 +0100
changeset 34013 440b16f4ac75e75520abab02190c783804df42cf
parent 34012 55730e9b6a014fee12a6db0dfbf9bbfad50aa355
child 34014 510c9f5221da95e4b157918b53cedbf0a29f6684
push id19258
push userfrgrahl@gmx.net
push dateMon, 11 Oct 2021 21:37:06 +0000
treeherdercomm-central@ca5e62a6d75f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg
bugs1730392, 596371
Bug 1730392 - Port |Bug 596371 - Put <browser> in a <stack> so it's easy to overlay| to SeaMonkey. r=frg
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -89,18 +89,20 @@
                      onerror="this.parentNode.parentNode.parentNode.parentNode.addToMissedIconCache(this.getAttribute('image'));
                               this.removeAttribute('image');"
                      width="0" flex="100"
                      class="tabbrowser-tab" label="&untitledTab;" crop="end"/>
           </xul:tabs>
         </xul:hbox>
         <xul:tabpanels flex="1" class="plain" selectedIndex="0" anonid="panelcontainer">
           <xul:notificationbox class="browser-notificationbox" xbl:inherits="popupnotification">
-            <xul:browser flex="1" type="content" primary="true"
-                         xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
+            <xul:stack flex="1" anonid="browserStack">
+              <xul:browser flex="1" type="content" primary="true"
+                           xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/>
+            </xul:stack>
           </xul:notificationbox>
         </xul:tabpanels>
       </xul:tabbox>
       <children/>
     </content>
     <implementation implements="nsIDOMEventListener, nsIObserver">
       <field name="closingTabsEnum" readonly="true">
         ({ ALL: 0, OTHER: 1, TO_END: 2 });
@@ -401,17 +403,18 @@
           ]]>
         </body>
       </method>
 
       <method name="getNotificationBox">
         <parameter name="aBrowser"/>
         <body>
           <![CDATA[
-            return aBrowser ? aBrowser.parentNode : this.mCurrentBrowser.parentNode;
+            return aBrowser ? aBrowser.parentNode.parentNode
+                            : this.mCurrentBrowser.parentNode.parentNode;
           ]]>
         </body>
       </method>
 
       <method name="_callProgressListeners">
         <parameter name="aBrowser"/>
         <parameter name="aMethod"/>
         <parameter name="aArguments"/>
@@ -1135,17 +1138,17 @@
         </body>
       </method>
 
       <field name="mAeroPeek">false</field>
 
       <method name="updateCurrentBrowser">
         <body>
           <![CDATA[
-            var newBrowser = this.mPanelContainer.selectedPanel.firstChild;
+            var newBrowser = this.mPanelContainer.selectedPanel.firstChild.firstChild;
             var oldBrowser = this.mCurrentBrowser;
 
             // Transfer the dropped link handler to the new browser.
             // Note: closing the current tab sets mCurrentBrowser to null
             //       so we use mCurrentTab.linkedBrowser instead.
             newBrowser.droppedLinkHandler = this.mCurrentTab.linkedBrowser.droppedLinkHandler;
             newBrowser.showWindowResizer = this.mCurrentTab.linkedBrowser.showWindowResizer;
             newBrowser.docShellIsActive = this.mCurrentTab.linkedBrowser.docShellIsActive;
@@ -1600,29 +1603,36 @@
             this.tabContainer.appendChild(t);
 
             var b = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
                                              "browser");
             b.setAttribute("type", "content");
             b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
             b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
             b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
-            b.setAttribute("flex", "1");
 
            // Check if we have a "parent" window which we need to set as our opener
            if (aOpener) {
              b.presetOpenerWindow(aOpener);
            }
 
+            // Create the browserStack container
+            var stack = document.createElementNS(
+                                    "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+                                    "stack");
+            stack.setAttribute("anonid", "browserStack");
+            stack.appendChild(b);
+            stack.setAttribute("flex", "1");
+
             // Add the Message and the Browser to the box
             var n = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
                                              "notificationbox");
             n.setAttribute("class", "browser-notificationbox");
             n.setAttribute("popupnotification", this.getAttribute("popupnotification"));
-            n.appendChild(b);
+            n.appendChild(stack);
 
             var uniqueId = "panel" + this.nextTabNumber++;
             n.id = uniqueId;
             t.linkedPanel = uniqueId;
             t.linkedBrowser = b;
             if (t.previousSibling.selected)
               t.setAttribute("afterselected", true);
 
@@ -3064,17 +3074,17 @@
       <constructor>
         <![CDATA[
           document.addEventListener("keypress", this);
           this.arrowKeysShouldWrap = AppConstants.platform == "macosx";
           // Bail out early if we are in tabmail. See Bug 521803.
           if (!this.mPanelContainer)
             return;
 
-          this.mCurrentBrowser = this.mPanelContainer.firstChild.firstChild;
+          this.mCurrentBrowser = this.mPanelContainer.firstChild.firstChild.firstChild;
           this.mCurrentTab = this.tabContainer.firstChild;
 
           var uniqueId = "panel" + this.nextTabNumber++;
           this.mPanelContainer.childNodes[0].id = uniqueId;
           this.tabs[0].linkedPanel = uniqueId;
           this.tabs[0].linkedBrowser = this.mCurrentBrowser;
 
           // Ensure the browser's session history and security UI are wired up