Bug 970605 - Use node.remove(), especially instead of node.parentNode.removeChild(node): mailnews. r=Ian

This commit is contained in:
Sebastian Hengst 2014-02-25 14:55:28 +01:00
Родитель bd9e191f23
Коммит e5b8c29d46
18 изменённых файлов: 26 добавлений и 26 удалений

Просмотреть файл

@ -65,7 +65,7 @@
// Empty out anything in the list. // Empty out anything in the list.
while (this.hasChildNodes()) while (this.hasChildNodes())
this.removeChild(this.lastChild); this.lastChild.remove();
]]> ]]>
</destructor> </destructor>

Просмотреть файл

@ -58,7 +58,7 @@ function fillDirectoryList()
// Empty out anything in the list // Empty out anything in the list
while (abList.hasChildNodes()) while (abList.hasChildNodes())
abList.removeChild(abList.lastChild); abList.lastChild.remove();
// Init the address book list // Init the address book list
let directories = MailServices.ab.directories; let directories = MailServices.ab.directories;

Просмотреть файл

@ -788,7 +788,7 @@
continue; continue;
if ("_teardown" in child) if ("_teardown" in child)
child._teardown(); child._teardown();
this.removeChild(child); child.remove();
} }
this._removeListener(); this._removeListener();

Просмотреть файл

@ -1495,8 +1495,8 @@ var gAccountTree = {
let mainTree = document.getElementById("account-tree-children"); let mainTree = document.getElementById("account-tree-children");
// Clear off all children... // Clear off all children...
while (mainTree.firstChild) while (mainTree.hasChildNodes())
mainTree.removeChild(mainTree.firstChild); mainTree.lastChild.remove();
for (let account of accounts) { for (let account of accounts) {
let accountName = null; let accountName = null;

Просмотреть файл

@ -208,7 +208,7 @@ function initAccountWizardTB(args) {
let acctyperadio = document.getElementById("acctyperadio"); let acctyperadio = document.getElementById("acctyperadio");
let feedRadio = acctyperadio.querySelector("radio[value='Feeds']"); let feedRadio = acctyperadio.querySelector("radio[value='Feeds']");
if (feedRadio) if (feedRadio)
feedRadio.parentNode.removeChild(feedRadio); feedRadio.remove();
if (selType) { if (selType) {
acctyperadio.selectedItem = acctyperadio.querySelector("radio[value='"+selType+"']"); acctyperadio.selectedItem = acctyperadio.querySelector("radio[value='"+selType+"']");
accountwizard.advance("identitypage"); accountwizard.advance("identitypage");

Просмотреть файл

@ -1180,7 +1180,7 @@ EmailConfigWizard.prototype =
// menulist.removeAllItems() is nice, but nicely clears the user value, too // menulist.removeAllItems() is nice, but nicely clears the user value, too
var popup = menu.menupopup; var popup = menu.menupopup;
while (popup.hasChildNodes()) while (popup.hasChildNodes())
popup.removeChild(popup.firstChild); popup.lastChild.remove();
// add standard ports // add standard ports
var autoPort = gStringsBundle.getString("port_auto"); var autoPort = gStringsBundle.getString("port_auto");

Просмотреть файл

@ -41,7 +41,7 @@ function refreshIdentityList(aSelectIndex)
{ {
// Remove all children. // Remove all children.
while (gIdentityListBox.hasChildNodes()) while (gIdentityListBox.hasChildNodes())
gIdentityListBox.removeChild(gIdentityListBox.lastChild); gIdentityListBox.lastChild.remove();
// Build the list from the identities array. // Build the list from the identities array.
let identities = gAccount.identities; let identities = gAccount.identities;

Просмотреть файл

@ -346,7 +346,7 @@ function loadSMTPServerList()
var smtpPopup = document.getElementById("smtpPopup"); var smtpPopup = document.getElementById("smtpPopup");
while (smtpPopup.lastChild.nodeName != "menuseparator") while (smtpPopup.lastChild.nodeName != "menuseparator")
smtpPopup.removeChild(smtpPopup.lastChild); smtpPopup.lastChild.remove();
while (servers.hasMoreElements()) while (servers.hasMoreElements())
{ {

Просмотреть файл

@ -60,7 +60,7 @@ function onInit(aPageId, aServerId)
// Ensure the whitelist is empty // Ensure the whitelist is empty
while (wList.hasChildNodes()) { while (wList.hasChildNodes()) {
wList.removeChild(wList.lastChild); wList.lastChild.remove();
} }
// Populate the listbox with address books // Populate the listbox with address books
@ -239,7 +239,7 @@ function buildServerFilterMenuList()
let ispHeaderList = document.getElementById("useServerFilterList"); let ispHeaderList = document.getElementById("useServerFilterList");
// Ensure the menulist is empty. // Ensure the menulist is empty.
while (ispHeaderList.hasChildNodes()) { while (ispHeaderList.hasChildNodes()) {
ispHeaderList.removeChild(ispHeaderList.lastChild); ispHeaderList.lastChild.remove();
} }
// Now walk through the isp directories looking for sfd files. // Now walk through the isp directories looking for sfd files.

Просмотреть файл

@ -147,7 +147,7 @@ var gSmtpServerListWindow =
{ {
// remove all children // remove all children
while (this.mServerList.hasChildNodes()) while (this.mServerList.hasChildNodes())
this.mServerList.removeChild(this.mServerList.lastChild); this.mServerList.lastChild.remove();
this.fillSmtpServers(this.mServerList, this.fillSmtpServers(this.mServerList,
MailServices.smtp.servers, MailServices.smtp.servers,

Просмотреть файл

@ -93,8 +93,8 @@ function clearEmailTextItems()
{ {
var emailDescText = document.getElementById("emailDescText"); var emailDescText = document.getElementById("emailDescText");
if (emailDescText.firstChild) if (emailDescText.hasChildNodes())
emailDescText.removeChild(emailDescText.firstChild); emailDescText.firstChild.remove();
var postEmailText = document.getElementById("postEmailText"); var postEmailText = document.getElementById("postEmailText");
postEmailText.setAttribute("value", ""); postEmailText.setAttribute("value", "");

Просмотреть файл

@ -146,7 +146,7 @@ function onRemoveHeader()
{ {
var listitem = gHdrsList.selectedItems[0] var listitem = gHdrsList.selectedItems[0]
if (!listitem) return; if (!listitem) return;
gHdrsList.removeChild(listitem); listitem.remove();
var selectedHdr = GetListItemAttributeStr(listitem); var selectedHdr = GetListItemAttributeStr(listitem);
var j=0; var j=0;
for (var i = 0; i < gArrayHdrs.length; i++) for (var i = 0; i < gArrayHdrs.length; i++)

Просмотреть файл

@ -460,7 +460,7 @@ function removeSearchRow(index)
//dump("That wasn't real. ignoring \n"); //dump("That wasn't real. ignoring \n");
} }
listitem.parentNode.removeChild(listitem); listitem.remove();
// now remove the item from our list of terms // now remove the item from our list of terms
gSearchTerms.splice(index, 1); gSearchTerms.splice(index, 1);

Просмотреть файл

@ -576,7 +576,7 @@
// this.mListBox will fail after the row is removed, so save it // this.mListBox will fail after the row is removed, so save it
let listBox = this.mListBox; let listBox = this.mListBox;
if (listBox.getRowCount() > 1) if (listBox.getRowCount() > 1)
listBox.removeChild(this); this.remove();
// can't use 'this' as it is destroyed now // can't use 'this' as it is destroyed now
listBox.getItemAtIndex(0).updateRemoveButton(); listBox.getItemAtIndex(0).updateRemoveButton();
checkActionsReorder(); checkActionsReorder();

Просмотреть файл

@ -72,8 +72,8 @@
setTimeout(function(self) self.adjustHeight(), 0, this); setTimeout(function(self) self.adjustHeight(), 0, this);
// remove all child nodes because we never want to reuse them. // remove all child nodes because we never want to reuse them.
while (this.richlistbox.lastChild) while (this.richlistbox.hasChildNodes())
this.richlistbox.removeChild(this.richlistbox.lastChild); this.richlistbox.lastChild.remove();
this._currentIndex = 0; this._currentIndex = 0;
this._appendCurrentResult(); this._appendCurrentResult();
@ -202,7 +202,7 @@
<![CDATA[ <![CDATA[
// Get rid of all previous text // Get rid of all previous text
while (aDescriptionElement.hasChildNodes()) while (aDescriptionElement.hasChildNodes())
aDescriptionElement.removeChild(aDescriptionElement.firstChild); aDescriptionElement.lastChild.remove();
// Get the indices that separate match and non-match text // Get the indices that separate match and non-match text
let search = this.getAttribute("text"); let search = this.getAttribute("text");
@ -617,7 +617,7 @@
<![CDATA[ <![CDATA[
// clear out any lingering children // clear out any lingering children
while (this._identityHolder.hasChildNodes()) while (this._identityHolder.hasChildNodes())
this._identityHolder.removeChild(this._identityHolder.firstChild); this._identityHolder.lastChild.remove();
var row = this.row; var row = this.row;
if (row == null) if (row == null)

Просмотреть файл

@ -23,7 +23,7 @@ function setText(id, value) {
if (!element) if (!element)
return; return;
if (element.hasChildNodes()) if (element.hasChildNodes())
element.removeChild(element.firstChild); element.firstChild.remove();
var textNode = document.createTextNode(value); var textNode = document.createTextNode(value);
element.appendChild(textNode); element.appendChild(textNode);
} }

Просмотреть файл

@ -359,7 +359,7 @@ function ListModules() {
var body = document.getElementById( "moduleList"); var body = document.getElementById( "moduleList");
while (body.hasChildNodes()) { while (body.hasChildNodes()) {
body.removeChild(body.lastChild); body.lastChild.remove();
} }
var count = top.importService.GetModuleCount(top.importType); var count = top.importService.GetModuleCount(top.importType);
@ -392,7 +392,7 @@ function AddModuleToList(moduleName, index)
function ListFeedAccounts() { function ListFeedAccounts() {
let body = document.getElementById( "moduleList"); let body = document.getElementById( "moduleList");
while (body.hasChildNodes()) while (body.hasChildNodes())
body.removeChild(body.lastChild); body.lastChild.remove();
// Add item to allow for new account creation. // Add item to allow for new account creation.
let item = document.createElement("listitem"); let item = document.createElement("listitem");
@ -1070,7 +1070,7 @@ function back()
// Clear out the results box. // Clear out the results box.
var results = document.getElementById("results"); var results = document.getElementById("results");
while (results.hasChildNodes()) while (results.hasChildNodes())
results.removeChild(results.lastChild); results.lastChild.remove();
// Reset the next button. // Reset the next button.
var nextButton = document.getElementById("forward"); var nextButton = document.getElementById("forward");

Просмотреть файл

@ -54,7 +54,7 @@ function setText(id, value) {
return; return;
if (element.hasChildNodes()) if (element.hasChildNodes())
element.removeChild(element.firstChild); element.firstChild.remove();
let textNode = document.createTextNode(value); let textNode = document.createTextNode(value);
element.appendChild(textNode); element.appendChild(textNode);
} }