From e5b8c29d46da295510bf70f7fe4f1001e19451d5 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Tue, 25 Feb 2014 14:55:28 +0100 Subject: [PATCH] Bug 970605 - Use node.remove(), especially instead of node.parentNode.removeChild(node): mailnews. r=Ian --- mailnews/addrbook/content/addrbookWidgets.xml | 2 +- mailnews/addrbook/prefs/content/pref-editdirectories.js | 2 +- mailnews/base/content/folderWidgets.xml | 2 +- mailnews/base/prefs/content/AccountManager.js | 4 ++-- mailnews/base/prefs/content/accountUtils.js | 2 +- .../base/prefs/content/accountcreation/emailWizard.js | 2 +- mailnews/base/prefs/content/am-identities-list.js | 2 +- mailnews/base/prefs/content/am-identity-edit.js | 2 +- mailnews/base/prefs/content/am-junk.js | 4 ++-- mailnews/base/prefs/content/am-smtp.js | 2 +- mailnews/base/prefs/content/aw-identity.js | 4 ++-- mailnews/base/search/content/CustomHeaders.js | 2 +- mailnews/base/search/content/searchTermOverlay.js | 2 +- mailnews/base/search/content/searchWidgets.xml | 2 +- mailnews/db/gloda/content/glodacomplete.xml | 8 ++++---- mailnews/extensions/smime/content/msgReadSecurityInfo.js | 2 +- mailnews/import/content/importDialog.js | 6 +++--- mailnews/news/content/downloadheaders.js | 2 +- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/mailnews/addrbook/content/addrbookWidgets.xml b/mailnews/addrbook/content/addrbookWidgets.xml index a3366c0a1b..8fd7e411ea 100644 --- a/mailnews/addrbook/content/addrbookWidgets.xml +++ b/mailnews/addrbook/content/addrbookWidgets.xml @@ -65,7 +65,7 @@ // Empty out anything in the list. while (this.hasChildNodes()) - this.removeChild(this.lastChild); + this.lastChild.remove(); ]]> diff --git a/mailnews/addrbook/prefs/content/pref-editdirectories.js b/mailnews/addrbook/prefs/content/pref-editdirectories.js index bf5c059d3c..dfb3e05590 100644 --- a/mailnews/addrbook/prefs/content/pref-editdirectories.js +++ b/mailnews/addrbook/prefs/content/pref-editdirectories.js @@ -58,7 +58,7 @@ function fillDirectoryList() // Empty out anything in the list while (abList.hasChildNodes()) - abList.removeChild(abList.lastChild); + abList.lastChild.remove(); // Init the address book list let directories = MailServices.ab.directories; diff --git a/mailnews/base/content/folderWidgets.xml b/mailnews/base/content/folderWidgets.xml index 9358ed55e9..403f6ac5f9 100644 --- a/mailnews/base/content/folderWidgets.xml +++ b/mailnews/base/content/folderWidgets.xml @@ -788,7 +788,7 @@ continue; if ("_teardown" in child) child._teardown(); - this.removeChild(child); + child.remove(); } this._removeListener(); diff --git a/mailnews/base/prefs/content/AccountManager.js b/mailnews/base/prefs/content/AccountManager.js index b98dd9bdbc..e47d527933 100644 --- a/mailnews/base/prefs/content/AccountManager.js +++ b/mailnews/base/prefs/content/AccountManager.js @@ -1495,8 +1495,8 @@ var gAccountTree = { let mainTree = document.getElementById("account-tree-children"); // Clear off all children... - while (mainTree.firstChild) - mainTree.removeChild(mainTree.firstChild); + while (mainTree.hasChildNodes()) + mainTree.lastChild.remove(); for (let account of accounts) { let accountName = null; diff --git a/mailnews/base/prefs/content/accountUtils.js b/mailnews/base/prefs/content/accountUtils.js index 1886662c3c..cbe0c487ae 100644 --- a/mailnews/base/prefs/content/accountUtils.js +++ b/mailnews/base/prefs/content/accountUtils.js @@ -208,7 +208,7 @@ function initAccountWizardTB(args) { let acctyperadio = document.getElementById("acctyperadio"); let feedRadio = acctyperadio.querySelector("radio[value='Feeds']"); if (feedRadio) - feedRadio.parentNode.removeChild(feedRadio); + feedRadio.remove(); if (selType) { acctyperadio.selectedItem = acctyperadio.querySelector("radio[value='"+selType+"']"); accountwizard.advance("identitypage"); diff --git a/mailnews/base/prefs/content/accountcreation/emailWizard.js b/mailnews/base/prefs/content/accountcreation/emailWizard.js index 586c080ead..62793c09cd 100644 --- a/mailnews/base/prefs/content/accountcreation/emailWizard.js +++ b/mailnews/base/prefs/content/accountcreation/emailWizard.js @@ -1180,7 +1180,7 @@ EmailConfigWizard.prototype = // menulist.removeAllItems() is nice, but nicely clears the user value, too var popup = menu.menupopup; while (popup.hasChildNodes()) - popup.removeChild(popup.firstChild); + popup.lastChild.remove(); // add standard ports var autoPort = gStringsBundle.getString("port_auto"); diff --git a/mailnews/base/prefs/content/am-identities-list.js b/mailnews/base/prefs/content/am-identities-list.js index c62afb2b4f..413a598b4a 100644 --- a/mailnews/base/prefs/content/am-identities-list.js +++ b/mailnews/base/prefs/content/am-identities-list.js @@ -41,7 +41,7 @@ function refreshIdentityList(aSelectIndex) { // Remove all children. while (gIdentityListBox.hasChildNodes()) - gIdentityListBox.removeChild(gIdentityListBox.lastChild); + gIdentityListBox.lastChild.remove(); // Build the list from the identities array. let identities = gAccount.identities; diff --git a/mailnews/base/prefs/content/am-identity-edit.js b/mailnews/base/prefs/content/am-identity-edit.js index 703bcacd85..87e5c025cf 100644 --- a/mailnews/base/prefs/content/am-identity-edit.js +++ b/mailnews/base/prefs/content/am-identity-edit.js @@ -346,7 +346,7 @@ function loadSMTPServerList() var smtpPopup = document.getElementById("smtpPopup"); while (smtpPopup.lastChild.nodeName != "menuseparator") - smtpPopup.removeChild(smtpPopup.lastChild); + smtpPopup.lastChild.remove(); while (servers.hasMoreElements()) { diff --git a/mailnews/base/prefs/content/am-junk.js b/mailnews/base/prefs/content/am-junk.js index d8f0c76f1a..1673832ffe 100644 --- a/mailnews/base/prefs/content/am-junk.js +++ b/mailnews/base/prefs/content/am-junk.js @@ -60,7 +60,7 @@ function onInit(aPageId, aServerId) // Ensure the whitelist is empty while (wList.hasChildNodes()) { - wList.removeChild(wList.lastChild); + wList.lastChild.remove(); } // Populate the listbox with address books @@ -239,7 +239,7 @@ function buildServerFilterMenuList() let ispHeaderList = document.getElementById("useServerFilterList"); // Ensure the menulist is empty. while (ispHeaderList.hasChildNodes()) { - ispHeaderList.removeChild(ispHeaderList.lastChild); + ispHeaderList.lastChild.remove(); } // Now walk through the isp directories looking for sfd files. diff --git a/mailnews/base/prefs/content/am-smtp.js b/mailnews/base/prefs/content/am-smtp.js index 6284e0d63a..4bcb794ace 100644 --- a/mailnews/base/prefs/content/am-smtp.js +++ b/mailnews/base/prefs/content/am-smtp.js @@ -147,7 +147,7 @@ var gSmtpServerListWindow = { // remove all children while (this.mServerList.hasChildNodes()) - this.mServerList.removeChild(this.mServerList.lastChild); + this.mServerList.lastChild.remove(); this.fillSmtpServers(this.mServerList, MailServices.smtp.servers, diff --git a/mailnews/base/prefs/content/aw-identity.js b/mailnews/base/prefs/content/aw-identity.js index 3c856b9e21..ed99c4400c 100644 --- a/mailnews/base/prefs/content/aw-identity.js +++ b/mailnews/base/prefs/content/aw-identity.js @@ -93,8 +93,8 @@ function clearEmailTextItems() { var emailDescText = document.getElementById("emailDescText"); - if (emailDescText.firstChild) - emailDescText.removeChild(emailDescText.firstChild); + if (emailDescText.hasChildNodes()) + emailDescText.firstChild.remove(); var postEmailText = document.getElementById("postEmailText"); postEmailText.setAttribute("value", ""); diff --git a/mailnews/base/search/content/CustomHeaders.js b/mailnews/base/search/content/CustomHeaders.js index 019adbee9a..a9d9bbccb3 100644 --- a/mailnews/base/search/content/CustomHeaders.js +++ b/mailnews/base/search/content/CustomHeaders.js @@ -146,7 +146,7 @@ function onRemoveHeader() { var listitem = gHdrsList.selectedItems[0] if (!listitem) return; - gHdrsList.removeChild(listitem); + listitem.remove(); var selectedHdr = GetListItemAttributeStr(listitem); var j=0; for (var i = 0; i < gArrayHdrs.length; i++) diff --git a/mailnews/base/search/content/searchTermOverlay.js b/mailnews/base/search/content/searchTermOverlay.js index 181207b706..578384e41c 100644 --- a/mailnews/base/search/content/searchTermOverlay.js +++ b/mailnews/base/search/content/searchTermOverlay.js @@ -460,7 +460,7 @@ function removeSearchRow(index) //dump("That wasn't real. ignoring \n"); } - listitem.parentNode.removeChild(listitem); + listitem.remove(); // now remove the item from our list of terms gSearchTerms.splice(index, 1); diff --git a/mailnews/base/search/content/searchWidgets.xml b/mailnews/base/search/content/searchWidgets.xml index 6194d547e6..01e081147e 100644 --- a/mailnews/base/search/content/searchWidgets.xml +++ b/mailnews/base/search/content/searchWidgets.xml @@ -576,7 +576,7 @@ // this.mListBox will fail after the row is removed, so save it let listBox = this.mListBox; if (listBox.getRowCount() > 1) - listBox.removeChild(this); + this.remove(); // can't use 'this' as it is destroyed now listBox.getItemAtIndex(0).updateRemoveButton(); checkActionsReorder(); diff --git a/mailnews/db/gloda/content/glodacomplete.xml b/mailnews/db/gloda/content/glodacomplete.xml index f8953e3008..609c6cadb4 100644 --- a/mailnews/db/gloda/content/glodacomplete.xml +++ b/mailnews/db/gloda/content/glodacomplete.xml @@ -72,8 +72,8 @@ setTimeout(function(self) self.adjustHeight(), 0, this); // remove all child nodes because we never want to reuse them. - while (this.richlistbox.lastChild) - this.richlistbox.removeChild(this.richlistbox.lastChild); + while (this.richlistbox.hasChildNodes()) + this.richlistbox.lastChild.remove(); this._currentIndex = 0; this._appendCurrentResult(); @@ -202,7 +202,7 @@