Bug 1479125 - Fixes on top of the scripted change draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 01 Aug 2018 12:32:09 -0700
changeset 825432 d9a4e3469c1795ebd2014fd44339579fd2708e20
parent 825431 777260ceed6afc8589ae9207855064c49509de54
push id118108
push userbgrinstead@mozilla.com
push dateWed, 01 Aug 2018 19:33:02 +0000
bugs1479125
milestone63.0a1
Bug 1479125 - Fixes on top of the scripted change MozReview-Commit-ID: C7yBwHuu7mA
browser/base/content/browser-addons.js
browser/base/content/urlbarBindings.xml
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/content/panelUI.js
browser/components/extensions/test/browser/browser_ext_tabs_hide.js
toolkit/content/widgets/richlistbox.xml
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -125,18 +125,18 @@ var gXPInstallObserver = {
 
     options.eventCallback = (aEvent) => {
       switch (aEvent) {
         case "removed":
           cancelInstallation();
           break;
         case "shown":
           let addonList = document.getElementById("addon-install-confirmation-content");
-          while (addonList.firstElementChild)
-            addonList.firstElementChild.remove();
+          while (addonList.firstChild)
+            addonList.firstChild.remove();
 
           for (let install of installInfo.installs) {
             let container = document.createElement("hbox");
 
             let name = document.createElement("label");
             name.setAttribute("value", install.addon.name);
             name.setAttribute("class", "addon-install-confirmation-name");
             container.appendChild(name);
@@ -496,18 +496,18 @@ var gExtensionsNotifications = {
   },
 
   updateAlerts() {
     let sideloaded = ExtensionsUI.sideloaded;
     let updates = ExtensionsUI.updates;
 
     let container = PanelUI.addonNotificationContainer;
 
-    while (container.firstElementChild) {
-      container.firstElementChild.remove();
+    while (container.firstChild) {
+      container.firstChild.remove();
     }
 
     let items = 0;
     for (let update of updates) {
       if (++items > 4) {
         break;
       }
       let text = gNavigatorBundle.getFormattedString("webextPerms.updateMenuItem", [update.addon.name]);
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -531,17 +531,17 @@ file, You can obtain one at http://mozil
             strikeOut.removeAllRanges();
             selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
             selection.removeAllRanges();
             this.formatScheme(controller.SELECTION_URLSTRIKEOUT, true);
             this.formatScheme(controller.SELECTION_URLSECONDARY, true);
             this.inputField.style.setProperty("--urlbar-scheme-size", "0px");
           }
 
-          let textNode = this.editor.rootElement.firstElementChild;
+          let textNode = this.editor.rootElement.firstChild;
           let value = textNode.textContent;
           if (!value)
             return;
 
           if (this.focused)
             return;
 
           // Get the URL from the fixup service:
@@ -652,17 +652,17 @@ file, You can obtain one at http://mozil
       </method>
 
       <method name="formatScheme">
         <parameter name="selectionType"/>
         <parameter name="clear"/>
         <body><![CDATA[
           let editor = this.scheme.editor;
           let controller = editor.selectionController;
-          let textNode = editor.rootElement.firstElementChild;
+          let textNode = editor.rootElement.firstChild;
           let selection = controller.getSelection(selectionType);
           if (clear) {
             selection.removeAllRanges();
           } else {
             let r = document.createRange();
             r.setStart(textNode, 0);
             r.setEnd(textNode, textNode.textContent.length);
             selection.addRange(r);
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -3954,18 +3954,18 @@ var CustomizableUI = {
    * @param aSubview the subview to clear.
    */
   clearSubview(aSubview) {
     let parent = aSubview.parentNode;
     // We'll take the container out of the document before cleaning it out
     // to avoid reflowing each time we remove something.
     parent.removeChild(aSubview);
 
-    while (aSubview.firstElementChild) {
-      aSubview.firstElementChild.remove();
+    while (aSubview.firstChild) {
+      aSubview.firstChild.remove();
     }
 
     parent.appendChild(aSubview);
   },
 };
 Object.freeze(this.CustomizableUI);
 Object.freeze(this.CustomizableUI.windows);
 
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -539,18 +539,18 @@ const PanelUI = {
     }
   },
 
   /**
    * Remove all the nodes from the 'Recent Highlights' section and hide it as well.
    */
   clearLibraryRecentHighlights() {
     let container = this.libraryRecentHighlights;
-    while (container.firstElementChild) {
-      container.firstElementChild.remove();
+    while (container.firstChild) {
+      container.firstChild.remove();
     }
     container.hidden = container.previousElementSibling.hidden =
       container.previousElementSibling.previousElementSibling.hidden = true;
   },
 
   /**
    * Event handler; invoked when an item of the Recent Highlights is clicked.
    *
@@ -621,18 +621,18 @@ const PanelUI = {
     buildHelpMenu();
 
     let helpMenu = document.getElementById("menu_HelpPopup");
     let items = this.getElementsByTagName("vbox")[0];
     let attrs = ["oncommand", "onclick", "label", "key", "disabled"];
     let NSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
     // Remove all buttons from the view
-    while (items.firstElementChild) {
-      items.firstElementChild.remove();
+    while (items.firstChild) {
+      items.firstChild.remove();
     }
 
     // Add the current set of menuitems of the Help menu to this view
     let menuItems = Array.prototype.slice.call(helpMenu.getElementsByTagName("menuitem"));
     let fragment = document.createDocumentFragment();
     for (let node of menuItems) {
       if (node.hidden)
         continue;
--- a/browser/components/extensions/test/browser/browser_ext_tabs_hide.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_hide.js
@@ -198,17 +198,17 @@ add_task(async function test_tabs_showhi
   // hidden.  The rest of the tabs should be hidden at this point.  Hidden
   // status was already validated inside the extension, this double checks
   // from chrome code.
   let otherwin;
   for (let win of BrowserWindowIterator()) {
     if (win != window) {
       otherwin = win;
     }
-    let tabs = Array.from(win.gBrowser.tabs.values());
+    let tabs = Array.from(win.gBrowser.tabs);
     ok(!tabs[0].hidden, "first tab not hidden");
     for (let i = 1; i < tabs.length; i++) {
       ok(tabs[i].hidden, "tab hidden value is correct");
       let id = SessionStore.getCustomTabValue(tabs[i], "hiddenBy");
       is(id, extension.id, "tab hiddenBy value is correct");
       await TabStateFlusher.flush(tabs[i].linkedBrowser);
     }
 
@@ -217,17 +217,17 @@ add_task(async function test_tabs_showhi
   }
 
   // Close the other window then restore it to test that the tabs are
   // restored with proper hidden state, and the correct extension id.
   await BrowserTestUtils.closeWindow(otherwin);
 
   otherwin = SessionStore.undoCloseWindow(0);
   await BrowserTestUtils.waitForEvent(otherwin, "load");
-  let tabs = Array.from(otherwin.gBrowser.tabs.values());
+  let tabs = Array.from(otherwin.gBrowser.tabs);
   ok(!tabs[0].hidden, "first tab not hidden");
   for (let i = 1; i < tabs.length; i++) {
     ok(tabs[i].hidden, "tab hidden value is correct");
     let id = SessionStore.getCustomTabValue(tabs[i], "hiddenBy");
     is(id, extension.id, "tab hiddenBy value is correct");
   }
 
   // Test closing the last visible tab, the next tab which is hidden should become
@@ -237,17 +237,17 @@ add_task(async function test_tabs_showhi
   ok(!otherwin.gBrowser.selectedTab.hidden, "tab was unhidden");
 
   // Showall will unhide any remaining hidden tabs.
   extension.sendMessage("showall");
   await extension.awaitMessage("shown");
 
   // Check from chrome code that all tabs are visible again.
   for (let win of BrowserWindowIterator()) {
-    let tabs = Array.from(win.gBrowser.tabs.values());
+    let tabs = Array.from(win.gBrowser.tabs);
     for (let i = 0; i < tabs.length; i++) {
       ok(!tabs[i].hidden, "tab hidden value is correct");
     }
   }
 
   // Close second window.
   await BrowserTestUtils.closeWindow(otherwin);
 
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -580,18 +580,18 @@
           ]]>
         </body>
       </method>
 
       <property name="children" readonly="true">
         <getter>
           <![CDATA[
             let iface = Ci.nsIDOMXULSelectControlItemElement;
-            let children = Array.from(this.children)
-                                .filter(node => node instanceof iface);
+            let children = Array.from(this.childNodes)
+                                .filter(node => node.nodeType == 1 && node instanceof iface);
             if (this.dir == "reverse" && this._mayReverse) {
               children.reverse();
             }
             return children;
           ]]>
         </getter>
       </property>