Bug 1584160 - Restore persisted state of all toolbars possibly affected by an overlay. r=pmorris
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 05 Nov 2019 12:19:24 +1300
changeset 36564 e2512bf794d189e23fd412f3e7d12cd877f8e2db
parent 36563 715b0e356aa08bb8a65e34bb16b7895b04068465
child 36565 edadee96ce8163c1b6d1917ae8b2a1d12a18e152
push id2534
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:52:51 +0000
treeherdercomm-beta@055c50840778 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspmorris
bugs1584160
Bug 1584160 - Restore persisted state of all toolbars possibly affected by an overlay. r=pmorris
common/src/Overlays.jsm
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -346,18 +346,19 @@ class Overlays {
               } could not be found, deferring to later`
             );
             return false;
           }
 
           target = palette;
         }
 
+        this._toolbarsToResolve.push(...box.querySelectorAll("toolbar"));
         this._toolbarsToResolve.push(
-          ...box.querySelectorAll('toolbar:not([type="menubar"])')
+          ...this.document.querySelectorAll(`toolbar[toolboxid="${box.id}"]`)
         );
       } else if (!target) {
         oconsole.debug(
           `The node ${node.id} could not be found, deferring to later`
         );
         return false;
       }
 
@@ -381,16 +382,22 @@ class Overlays {
       if (element.id && this.persistedIDs.has(element.id)) {
         element.setAttribute(
           "value",
           Services.xulStore.getValue(this.location, element.id, "value")
         );
       }
     }
 
+    if (node.localName == "toolbar") {
+      this._toolbarsToResolve.push(node);
+    } else {
+      this._toolbarsToResolve.push(...node.querySelectorAll("toolbar"));
+    }
+
     let wasInserted = false;
     let pos = node.getAttribute("insertafter");
     let after = true;
 
     if (!pos) {
       pos = node.getAttribute("insertbefore");
       after = false;
     }