Bug 970605 - Use node.remove(), especially instead of node.parentNode.removeChild(node): mailnews. r=Ian
This commit is contained in:
Родитель
bd9e191f23
Коммит
e5b8c29d46
|
@ -65,7 +65,7 @@
|
|||
|
||||
// Empty out anything in the list.
|
||||
while (this.hasChildNodes())
|
||||
this.removeChild(this.lastChild);
|
||||
this.lastChild.remove();
|
||||
]]>
|
||||
</destructor>
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -788,7 +788,7 @@
|
|||
continue;
|
||||
if ("_teardown" in child)
|
||||
child._teardown();
|
||||
this.removeChild(child);
|
||||
child.remove();
|
||||
}
|
||||
|
||||
this._removeListener();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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", "");
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 @@
|
|||
<![CDATA[
|
||||
// Get rid of all previous text
|
||||
while (aDescriptionElement.hasChildNodes())
|
||||
aDescriptionElement.removeChild(aDescriptionElement.firstChild);
|
||||
aDescriptionElement.lastChild.remove();
|
||||
|
||||
// Get the indices that separate match and non-match text
|
||||
let search = this.getAttribute("text");
|
||||
|
@ -617,7 +617,7 @@
|
|||
<![CDATA[
|
||||
// clear out any lingering children
|
||||
while (this._identityHolder.hasChildNodes())
|
||||
this._identityHolder.removeChild(this._identityHolder.firstChild);
|
||||
this._identityHolder.lastChild.remove();
|
||||
|
||||
var row = this.row;
|
||||
if (row == null)
|
||||
|
|
|
@ -23,7 +23,7 @@ function setText(id, value) {
|
|||
if (!element)
|
||||
return;
|
||||
if (element.hasChildNodes())
|
||||
element.removeChild(element.firstChild);
|
||||
element.firstChild.remove();
|
||||
var textNode = document.createTextNode(value);
|
||||
element.appendChild(textNode);
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ function ListModules() {
|
|||
|
||||
var body = document.getElementById( "moduleList");
|
||||
while (body.hasChildNodes()) {
|
||||
body.removeChild(body.lastChild);
|
||||
body.lastChild.remove();
|
||||
}
|
||||
|
||||
var count = top.importService.GetModuleCount(top.importType);
|
||||
|
@ -392,7 +392,7 @@ function AddModuleToList(moduleName, index)
|
|||
function ListFeedAccounts() {
|
||||
let body = document.getElementById( "moduleList");
|
||||
while (body.hasChildNodes())
|
||||
body.removeChild(body.lastChild);
|
||||
body.lastChild.remove();
|
||||
|
||||
// Add item to allow for new account creation.
|
||||
let item = document.createElement("listitem");
|
||||
|
@ -1070,7 +1070,7 @@ function back()
|
|||
// Clear out the results box.
|
||||
var results = document.getElementById("results");
|
||||
while (results.hasChildNodes())
|
||||
results.removeChild(results.lastChild);
|
||||
results.lastChild.remove();
|
||||
|
||||
// Reset the next button.
|
||||
var nextButton = document.getElementById("forward");
|
||||
|
|
|
@ -54,7 +54,7 @@ function setText(id, value) {
|
|||
return;
|
||||
|
||||
if (element.hasChildNodes())
|
||||
element.removeChild(element.firstChild);
|
||||
element.firstChild.remove();
|
||||
let textNode = document.createTextNode(value);
|
||||
element.appendChild(textNode);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче