diff --git a/accessible/tests/browser/e10s/browser_caching_name.js b/accessible/tests/browser/e10s/browser_caching_name.js
index 08e635014408..9a5fd3e26d5b 100644
--- a/accessible/tests/browser/e10s/browser_caching_name.js
+++ b/accessible/tests/browser/e10s/browser_caching_name.js
@@ -392,7 +392,7 @@ function* testSubtreeRule(browser, target, rule, expected) {
yield ContentTask.spawn(browser, target.id, id => {
let elm = content.document.getElementById(id);
while (elm.firstChild) {
- elm.removeChild(elm.firstChild);
+ elm.firstChild.remove();
}
});
yield updateAccessibleIfNeeded(onEvent, target);
diff --git a/accessible/tests/browser/e10s/browser_treeupdate_doc.js b/accessible/tests/browser/e10s/browser_treeupdate_doc.js
index ccb1d15668a1..73c6539e52c2 100644
--- a/accessible/tests/browser/e10s/browser_treeupdate_doc.js
+++ b/accessible/tests/browser/e10s/browser_treeupdate_doc.js
@@ -157,7 +157,7 @@ addAccessibleTask(`
yield ContentTask.spawn(browser, {}, () => {
// Remove HTML element.
let docNode = content.document.getElementById('iframe').contentDocument;
- docNode.removeChild(docNode.firstChild);
+ docNode.firstChild.remove();
});
let event = yield reorderEventPromise;
@@ -235,7 +235,7 @@ addAccessibleTask(`
let docEl =
content.document.getElementById('iframe').contentDocument.documentElement;
// Remove aftermath of this test before next test starts.
- docEl.removeChild(docEl.firstChild);
+ docEl.firstChild.remove();
});
// Make sure reorder event was fired and that the input was removed.
yield reorderEventPromise;
diff --git a/accessible/tests/browser/e10s/browser_treeupdate_optgroup.js b/accessible/tests/browser/e10s/browser_treeupdate_optgroup.js
index 45001afaac34..18953380dcc0 100644
--- a/accessible/tests/browser/e10s/browser_treeupdate_optgroup.js
+++ b/accessible/tests/browser/e10s/browser_treeupdate_optgroup.js
@@ -56,7 +56,7 @@ addAccessibleTask('', function*(browser, accDoc) {
// Remove grouping from combobox
yield ContentTask.spawn(browser, {}, () => {
let contentSelect = content.document.getElementById('select');
- contentSelect.removeChild(contentSelect.firstChild);
+ contentSelect.firstChild.remove();
});
yield onEvent;
diff --git a/accessible/tests/mochitest/events/test_mutation.html b/accessible/tests/mochitest/events/test_mutation.html
index 3e7dab6d46ac..4c9b8f33306a 100644
--- a/accessible/tests/mochitest/events/test_mutation.html
+++ b/accessible/tests/mochitest/events/test_mutation.html
@@ -414,8 +414,8 @@
var l1 = doc.firstChild;
this.target = l1.firstChild;
var l2 = doc.lastChild;
- l1.DOMNode.removeChild(l1.DOMNode.firstChild);
- l2.DOMNode.removeChild(l2.DOMNode.firstChild);
+ l1.DOMNode.firstChild.remove();
+ l2.DOMNode.firstChild.remove();
}
this.check = function hideHideNDestroyDoc_check()
diff --git a/accessible/tests/mochitest/events/test_text.html b/accessible/tests/mochitest/events/test_text.html
index d992d6c641df..76dd1ce49af0 100644
--- a/accessible/tests/mochitest/events/test_text.html
+++ b/accessible/tests/mochitest/events/test_text.html
@@ -51,7 +51,7 @@
this.invoke = function removeChildSpan_invoke()
{
// remove HTML span, a first child of the node
- this.DOMNode.removeChild(this.DOMNode.firstChild);
+ this.DOMNode.firstChild.remove();
}
this.getID = function removeChildSpan_getID()
@@ -162,7 +162,7 @@
this.DOMNode.removeChild(this.DOMNode.lastChild);
} else {
while (this.DOMNode.firstChild)
- this.DOMNode.removeChild(this.DOMNode.firstChild);
+ this.DOMNode.firstChild.remove();
}
}
diff --git a/accessible/tests/mochitest/name/markup.js b/accessible/tests/mochitest/name/markup.js
index d3ecd8982b08..9d1c09562ed0 100644
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -316,7 +316,7 @@ function testNameForSubtreeRule(aElm, aRule)
waitForEvent(EVENT_REORDER, aElm, gTestIterator.iterateNext, gTestIterator);
while (aElm.firstChild)
- aElm.removeChild(aElm.firstChild);
+ aElm.firstChild.remove();
}
/**
diff --git a/accessible/tests/mochitest/treeupdate/test_doc.html b/accessible/tests/mochitest/treeupdate/test_doc.html
index 05896e7b46fa..3d108b0359dc 100644
--- a/accessible/tests/mochitest/treeupdate/test_doc.html
+++ b/accessible/tests/mochitest/treeupdate/test_doc.html
@@ -266,7 +266,7 @@
// Remove HTML element.
var docNode = getDocNode(aID);
- docNode.removeChild(docNode.firstChild);
+ docNode.firstChild.remove();
}
this.getID = function removeHTMLFromIFrameDoc_getID()
diff --git a/accessible/tests/mochitest/treeupdate/test_general.html b/accessible/tests/mochitest/treeupdate/test_general.html
index 9a8862bea167..64ebdb52412f 100644
--- a/accessible/tests/mochitest/treeupdate/test_general.html
+++ b/accessible/tests/mochitest/treeupdate/test_general.html
@@ -64,7 +64,7 @@
this.invoke = function removeRemove_invoke()
{
- getNode(aContainer).removeChild(getNode(aContainer).firstChild);
+ getNode(aContainer).firstChild.remove();
}
this.finalCheck = function removeRemove_finalCheck()
diff --git a/accessible/tests/mochitest/treeupdate/test_optgroup.html b/accessible/tests/mochitest/treeupdate/test_optgroup.html
index 27323bbc38da..22495c8e9273 100644
--- a/accessible/tests/mochitest/treeupdate/test_optgroup.html
+++ b/accessible/tests/mochitest/treeupdate/test_optgroup.html
@@ -77,7 +77,7 @@
this.invoke = function removeOptGroup_invoke()
{
this.option1Node = this.selectNode.firstChild.firstChild;
- this.selectNode.removeChild(this.selectNode.firstChild);
+ this.selectNode.firstChild.remove();
}
this.eventSeq = [
diff --git a/browser/base/content/browser-ctrlTab.js b/browser/base/content/browser-ctrlTab.js
index df51349edb19..3e69c3b442fb 100644
--- a/browser/base/content/browser-ctrlTab.js
+++ b/browser/base/content/browser-ctrlTab.js
@@ -241,7 +241,7 @@ var ctrlTab = {
aPreview._tab = aTab;
if (aPreview.firstChild)
- aPreview.removeChild(aPreview.firstChild);
+ aPreview.firstChild.remove();
if (aTab) {
let canvasWidth = this.canvasWidth;
let canvasHeight = this.canvasHeight;
diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js
index 77f5e898ecda..7c6b16ab5456 100644
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -330,7 +330,7 @@ var gFxAccounts = {
populateSendTabToDevicesMenu(devicesPopup, url, title) {
// remove existing menu items
while (devicesPopup.hasChildNodes()) {
- devicesPopup.removeChild(devicesPopup.firstChild);
+ devicesPopup.firstChild.remove();
}
const fragment = document.createDocumentFragment();
diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js
index 372d107c5cf8..16dfd6d0d081 100644
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -746,7 +746,7 @@ HistoryMenu.prototype = {
// remove existing menu items
while (undoPopup.hasChildNodes())
- undoPopup.removeChild(undoPopup.firstChild);
+ undoPopup.firstChild.remove();
// no restorable tabs, so make sure menu is disabled, and return
if (this._getClosedTabCount() == 0) {
@@ -782,7 +782,7 @@ HistoryMenu.prototype = {
// remove existing menu items
while (undoPopup.hasChildNodes())
- undoPopup.removeChild(undoPopup.firstChild);
+ undoPopup.firstChild.remove();
// no restorable windows, so make sure menu is disabled, and return
if (SessionStore.getClosedWindowCount() == 0) {
diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js
index 98b12358beab..fca9da232b05 100644
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -418,7 +418,7 @@ function resetPageInfo(args) {
/* Reset Feeds Tab */
var feedListbox = document.getElementById("feedListbox");
while (feedListbox.firstChild)
- feedListbox.removeChild(feedListbox.firstChild);
+ feedListbox.firstChild.remove();
/* Call registered overlay reset functions */
onResetRegistry.forEach(function(func) { func(); });
diff --git a/browser/base/content/pageinfo/security.js b/browser/base/content/pageinfo/security.js
index 6daf61d14e03..507b477bed75 100644
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -306,7 +306,7 @@ function setText(id, value) {
element.value = value;
else {
if (element.hasChildNodes())
- element.removeChild(element.firstChild);
+ element.firstChild.remove();
var textNode = document.createTextNode(value);
element.appendChild(textNode);
}
diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js
index 94c1c98b0db8..9d37b9b816bb 100644
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -490,7 +490,7 @@ function createUserContextMenu(event, {
useAccessKeys = true
} = {}) {
while (event.target.hasChildNodes()) {
- event.target.removeChild(event.target.firstChild);
+ event.target.firstChild.remove();
}
let bundle = document.getElementById("bundle_browser");
diff --git a/browser/components/customizableui/CustomizableWidgets.jsm b/browser/components/customizableui/CustomizableWidgets.jsm
index 36f659ae82d3..e2959dbd7fe7 100644
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -244,12 +244,12 @@ const CustomizableWidgets = [
let recentlyClosedTabs = doc.getElementById("PanelUI-recentlyClosedTabs");
while (recentlyClosedTabs.firstChild) {
- recentlyClosedTabs.removeChild(recentlyClosedTabs.firstChild);
+ recentlyClosedTabs.firstChild.remove();
}
let recentlyClosedWindows = doc.getElementById("PanelUI-recentlyClosedWindows");
while (recentlyClosedWindows.firstChild) {
- recentlyClosedWindows.removeChild(recentlyClosedWindows.firstChild);
+ recentlyClosedWindows.firstChild.remove();
}
let utils = RecentlyClosedTabsAndWindowsMenuUtils;
diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js
index 6b29f3eee2fc..2ecddcbd7789 100644
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -492,7 +492,7 @@ const PanelUI = {
// Remove all buttons from the view
while (items.firstChild) {
- items.removeChild(items.firstChild);
+ items.firstChild.remove();
}
// Add the current set of menuitems of the Help menu to this view
diff --git a/browser/components/feeds/FeedWriter.js b/browser/components/feeds/FeedWriter.js
index a99bc4178d18..d82901e4aeb3 100644
--- a/browser/components/feeds/FeedWriter.js
+++ b/browser/components/feeds/FeedWriter.js
@@ -173,7 +173,7 @@ FeedWriter.prototype = {
let element = this._document.getElementById(id);
let textNode = text.createDocumentFragment(element);
while (element.hasChildNodes())
- element.removeChild(element.firstChild);
+ element.firstChild.remove();
element.appendChild(textNode);
if (text.base) {
element.setAttributeNS(XML_NS, "base", text.base.spec);
diff --git a/browser/components/migration/content/migration.js b/browser/components/migration/content/migration.js
index c5d485f12579..87b229a444ca 100644
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -185,7 +185,7 @@ var MigrationWizard = { /* exported MigrationWizard */
var profiles = document.getElementById("profiles");
while (profiles.hasChildNodes())
- profiles.removeChild(profiles.firstChild);
+ profiles.firstChild.remove();
// Note that this block is still reached even if the user chose 'From File'
// and we canceled the dialog. When that happens, _migrator will be null.
@@ -225,7 +225,7 @@ var MigrationWizard = { /* exported MigrationWizard */
onImportItemsPageShow() {
var dataSources = document.getElementById("dataSources");
while (dataSources.hasChildNodes())
- dataSources.removeChild(dataSources.firstChild);
+ dataSources.firstChild.remove();
var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
for (var i = 0; i < 16; ++i) {
@@ -367,7 +367,7 @@ var MigrationWizard = { /* exported MigrationWizard */
_listItems(aID) {
var items = document.getElementById(aID);
while (items.hasChildNodes())
- items.removeChild(items.firstChild);
+ items.firstChild.remove();
var itemID;
for (var i = 0; i < 16; ++i) {
diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js
index 1a40b334bceb..7dea0891dcd8 100644
--- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js
@@ -1011,7 +1011,7 @@ PlacesToolbar.prototype = {
this._openedMenuButton = null;
while (this._rootElt.hasChildNodes()) {
- this._rootElt.removeChild(this._rootElt.firstChild);
+ this._rootElt.firstChild.remove();
}
let cc = this._resultNode.childCount;
@@ -1952,7 +1952,7 @@ PlacesPanelMenuView.prototype = {
// Container is the toolbar itself.
while (this._rootElt.hasChildNodes()) {
- this._rootElt.removeChild(this._rootElt.firstChild);
+ this._rootElt.firstChild.remove();
}
for (let i = 0; i < this._resultNode.childCount; ++i) {
diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js
index 0ec3ef7531dd..bb97ea1c63fd 100644
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -419,7 +419,7 @@ var PlacesOrganizer = {
// Remove existing menu items. Last item is the restoreFromFile item.
while (restorePopup.childNodes.length > 1)
- restorePopup.removeChild(restorePopup.firstChild);
+ restorePopup.firstChild.remove();
Task.spawn(function* () {
let backupFiles = yield PlacesBackups.getBackupFiles();
@@ -1007,7 +1007,7 @@ var ViewMenu = {
return endElement;
}
while (popup.hasChildNodes()) {
- popup.removeChild(popup.firstChild);
+ popup.firstChild.remove();
}
return null;
},
diff --git a/browser/components/preferences/blocklists.js b/browser/components/preferences/blocklists.js
index c90d7ae5b773..c924133fd549 100644
--- a/browser/components/preferences/blocklists.js
+++ b/browser/components/preferences/blocklists.js
@@ -81,7 +81,7 @@ var gBlocklistManager = {
let blocklistsText = document.getElementById("blocklistsText");
while (blocklistsText.hasChildNodes()) {
- blocklistsText.removeChild(blocklistsText.firstChild);
+ blocklistsText.firstChild.remove();
}
blocklistsText.appendChild(document.createTextNode(params.introText));
diff --git a/browser/components/preferences/in-content/advanced.js b/browser/components/preferences/in-content/advanced.js
index fc345f8f60d4..3f23def56226 100644
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -557,7 +557,7 @@ var gAdvancedPane = {
var list = document.getElementById("offlineAppsList");
while (list.firstChild) {
- list.removeChild(list.firstChild);
+ list.firstChild.remove();
}
var groups;
diff --git a/browser/components/preferences/languages.js b/browser/components/preferences/languages.js
index 6ad9bb13673e..e107a252a139 100644
--- a/browser/components/preferences/languages.js
+++ b/browser/components/preferences/languages.js
@@ -97,7 +97,7 @@ var gLanguagesDialog = {
_buildAvailableLanguageList() {
var availableLanguagesPopup = document.getElementById("availableLanguagesPopup");
while (availableLanguagesPopup.hasChildNodes())
- availableLanguagesPopup.removeChild(availableLanguagesPopup.firstChild);
+ availableLanguagesPopup.firstChild.remove();
// Sort the list of languages by name
this._availableLanguagesList.sort(function(a, b) {
@@ -119,7 +119,7 @@ var gLanguagesDialog = {
readAcceptLanguages() {
while (this._activeLanguages.hasChildNodes())
- this._activeLanguages.removeChild(this._activeLanguages.firstChild);
+ this._activeLanguages.firstChild.remove();
var selectedIndex = 0;
var preference = document.getElementById("intl.accept_languages");
diff --git a/browser/components/preferences/permissions.js b/browser/components/preferences/permissions.js
index 1e188afcd23d..416d07e0bd57 100644
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -218,7 +218,7 @@ var gPermissionManager = {
var permissionsText = document.getElementById("permissionsText");
while (permissionsText.hasChildNodes())
- permissionsText.removeChild(permissionsText.firstChild);
+ permissionsText.firstChild.remove();
permissionsText.appendChild(document.createTextNode(aParams.introText));
document.title = aParams.windowTitle;
diff --git a/browser/components/syncedtabs/SyncedTabsDeckView.js b/browser/components/syncedtabs/SyncedTabsDeckView.js
index 4a31080297b5..8962e7b1854b 100644
--- a/browser/components/syncedtabs/SyncedTabsDeckView.js
+++ b/browser/components/syncedtabs/SyncedTabsDeckView.js
@@ -100,7 +100,7 @@ SyncedTabsDeckView.prototype = {
_clearChilden() {
while (this.container.firstChild) {
- this.container.removeChild(this.container.firstChild);
+ this.container.firstChild.remove();
}
},
diff --git a/browser/components/syncedtabs/TabListView.js b/browser/components/syncedtabs/TabListView.js
index a8d1ed9c66f6..fc68cd73dea1 100644
--- a/browser/components/syncedtabs/TabListView.js
+++ b/browser/components/syncedtabs/TabListView.js
@@ -169,7 +169,7 @@ TabListView.prototype = {
_clearChilden(node) {
let parent = node || this.container;
while (parent.firstChild) {
- parent.removeChild(parent.firstChild);
+ parent.firstChild.remove();
}
},
diff --git a/browser/components/uitour/UITour.jsm b/browser/components/uitour/UITour.jsm
index 4048ff1c490c..e1890a68c1bb 100644
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -1236,7 +1236,7 @@ this.UITour = {
// Remove all the children of the notice (rating container
// and the flex).
while (notice.firstChild) {
- notice.removeChild(notice.firstChild);
+ notice.firstChild.remove();
}
// Make sure that we have a valid URL. If we haven't, do not open the engagement page.
diff --git a/browser/extensions/pdfjs/content/web/viewer.js b/browser/extensions/pdfjs/content/web/viewer.js
index 42182992db0b..765f52e6d530 100644
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -3898,7 +3898,7 @@ var PDFAttachmentViewer = function PDFAttachmentViewerClosure() {
this.attachments = null;
var container = this.container;
while (container.firstChild) {
- container.removeChild(container.firstChild);
+ container.firstChild.remove();
}
if (!keepRenderedCapability) {
this._renderedCapability = pdfjsLib.createPromiseCapability();
@@ -4598,7 +4598,7 @@ var PDFOutlineViewer = function PDFOutlineViewerClosure() {
this.lastToggleIsShow = true;
var container = this.container;
while (container.firstChild) {
- container.removeChild(container.firstChild);
+ container.firstChild.remove();
}
},
_dispatchEvent: function PDFOutlineViewer_dispatchEvent(outlineCount) {
diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js
index c6ed2a7bb1f6..dddc5a6af7ba 100644
--- a/devtools/client/debugger/new/debugger.js
+++ b/devtools/client/debugger/new/debugger.js
@@ -36082,7 +36082,7 @@ return /******/ (function(modules) { // webpackBootstrap
function removeChildren(e) {
for (var count = e.childNodes.length; count > 0; --count)
- { e.removeChild(e.firstChild) }
+ { e.firstChild.remove() }
return e
}
diff --git a/devtools/client/framework/sidebar.js b/devtools/client/framework/sidebar.js
index 7625edf891e8..f611c4dfba3d 100644
--- a/devtools/client/framework/sidebar.js
+++ b/devtools/client/framework/sidebar.js
@@ -576,7 +576,7 @@ ToolSidebar.prototype = {
}
while (this._tabbox.tabs && this._tabbox.tabs.hasChildNodes()) {
- this._tabbox.tabs.removeChild(this._tabbox.tabs.firstChild);
+ this._tabbox.tabs.firstChild.remove();
}
if (this._currentTool && this._telemetry) {
diff --git a/devtools/client/inspector/markup/markup.js b/devtools/client/inspector/markup/markup.js
index 9d8201ff6f17..2c511e42fc6c 100644
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -1604,7 +1604,7 @@ MarkupView.prototype = {
// this container will do double duty as the container for the single
// text child.
while (container.children.firstChild) {
- container.children.removeChild(container.children.firstChild);
+ container.children.firstChild.remove();
}
container.setInlineTextChild(container.node.inlineTextChild);
@@ -1616,7 +1616,7 @@ MarkupView.prototype = {
if (!container.hasChildren) {
while (container.children.firstChild) {
- container.children.removeChild(container.children.firstChild);
+ container.children.firstChild.remove();
}
container.childrenDirty = false;
container.setExpanded(false);
@@ -1659,7 +1659,7 @@ MarkupView.prototype = {
}
while (container.children.firstChild) {
- container.children.removeChild(container.children.firstChild);
+ container.children.firstChild.remove();
}
if (!(children.hasFirst && children.hasLast)) {
diff --git a/devtools/client/scratchpad/scratchpad.js b/devtools/client/scratchpad/scratchpad.js
index 57256dd53771..6f2cc9a176d3 100644
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -1367,7 +1367,7 @@ var Scratchpad = {
recentFilesMenu.setAttribute("disabled", true);
while (recentFilesPopup.hasChildNodes()) {
- recentFilesPopup.removeChild(recentFilesPopup.firstChild);
+ recentFilesPopup.firstChild.remove();
}
if (filePaths.length > 0) {
diff --git a/devtools/client/shared/developer-toolbar.js b/devtools/client/shared/developer-toolbar.js
index db6fae81db93..d2dc161b34c5 100644
--- a/devtools/client/shared/developer-toolbar.js
+++ b/devtools/client/shared/developer-toolbar.js
@@ -1019,7 +1019,7 @@ OutputPanel.prototype._update = function () {
// Empty this._div
while (this._div.hasChildNodes()) {
- this._div.removeChild(this._div.firstChild);
+ this._div.firstChild.remove();
}
if (this.displayedOutput.data != null) {
@@ -1030,7 +1030,7 @@ OutputPanel.prototype._update = function () {
}
while (this._div.hasChildNodes()) {
- this._div.removeChild(this._div.firstChild);
+ this._div.firstChild.remove();
}
let links = node.querySelectorAll("*[href]");
diff --git a/devtools/client/shared/widgets/TableWidget.js b/devtools/client/shared/widgets/TableWidget.js
index e4c8ed7f263c..60784a9caaab 100644
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -1554,7 +1554,7 @@ Cell.prototype = {
this.label.removeAttribute("value");
while (this.label.firstChild) {
- this.label.removeChild(this.label.firstChild);
+ this.label.firstChild.remove();
}
this.label.appendChild(value);
diff --git a/devtools/client/shared/widgets/tooltip/Tooltip.js b/devtools/client/shared/widgets/tooltip/Tooltip.js
index 4bb3c52f01ae..5e013cbcae0a 100644
--- a/devtools/client/shared/widgets/tooltip/Tooltip.js
+++ b/devtools/client/shared/widgets/tooltip/Tooltip.js
@@ -201,7 +201,7 @@ Tooltip.prototype = {
*/
empty: function () {
while (this.panel.hasChildNodes()) {
- this.panel.removeChild(this.panel.firstChild);
+ this.panel.firstChild.remove();
}
},
diff --git a/devtools/client/styleeditor/StyleEditorUI.jsm b/devtools/client/styleeditor/StyleEditorUI.jsm
index ad3cb992df20..e35c8ffca54f 100644
--- a/devtools/client/styleeditor/StyleEditorUI.jsm
+++ b/devtools/client/styleeditor/StyleEditorUI.jsm
@@ -865,7 +865,7 @@ StyleEditorUI.prototype = {
let list = details.querySelector(".stylesheet-media-list");
while (list.firstChild) {
- list.removeChild(list.firstChild);
+ list.firstChild.remove();
}
let rules = editor.mediaRules;
diff --git a/devtools/shared/gcli/commands/csscoverage.js b/devtools/shared/gcli/commands/csscoverage.js
index 841cf4c7dff9..2c7516a67f2c 100644
--- a/devtools/shared/gcli/commands/csscoverage.js
+++ b/devtools/shared/gcli/commands/csscoverage.js
@@ -156,7 +156,7 @@ exports.items = [
onback: () => {
// The back button clears and hides .csscoverage-report
while (host.hasChildNodes()) {
- host.removeChild(host.firstChild);
+ host.firstChild.remove();
}
host.hidden = true;
}
diff --git a/devtools/shared/gcli/source/lib/gcli/util/util.js b/devtools/shared/gcli/source/lib/gcli/util/util.js
index 065bf36c07db..650e84b8f1f6 100644
--- a/devtools/shared/gcli/source/lib/gcli/util/util.js
+++ b/devtools/shared/gcli/source/lib/gcli/util/util.js
@@ -388,7 +388,7 @@ exports.createElement = function(doc, tag) {
*/
exports.clearElement = function(elem) {
while (elem.hasChildNodes()) {
- elem.removeChild(elem.firstChild);
+ elem.firstChild.remove();
}
};
diff --git a/docshell/test/chrome/bug303267.html b/docshell/test/chrome/bug303267.html
index 32b575eee8dc..98042e830b04 100644
--- a/docshell/test/chrome/bug303267.html
+++ b/docshell/test/chrome/bug303267.html
@@ -13,7 +13,7 @@ function showpageshowcount()
var div1 = document.getElementById("div1");
while (div1.firstChild)
{
- div1.removeChild(div1.firstChild);
+ div1.firstChild.remove();
}
div1.appendChild(document.createTextNode(
"pageshowcount: " + pageshowcount));
diff --git a/docshell/test/navigation/file_bug534178.html b/docshell/test/navigation/file_bug534178.html
index 8bcedb6fbabe..7e357945d34c 100644
--- a/docshell/test/navigation/file_bug534178.html
+++ b/docshell/test/navigation/file_bug534178.html
@@ -3,7 +3,7 @@
diff --git a/dom/tests/mochitest/webcomponents/test_shadow_element.html b/dom/tests/mochitest/webcomponents/test_shadow_element.html
index 4440650d7d9b..4b91535fc325 100644
--- a/dom/tests/mochitest/webcomponents/test_shadow_element.html
+++ b/dom/tests/mochitest/webcomponents/test_shadow_element.html
@@ -90,7 +90,7 @@ ok(firstDistNodes[0].id == "one" &&
firstDistNodes[3].id == "four", "Reprojection through shadow should preserve node order.");
// Remove a node from the host and make sure that it is removed from all insertion points.
-host.removeChild(host.firstChild);
+host.firstChild.remove();
firstDistNodes = firstContent.getDistributedNodes();
secondDistNodes = secondContent.getDistributedNodes();
@@ -115,7 +115,7 @@ firstShadow.appendChild(shadowChild);
is(firstContent.getDistributedNodes()[0], shadowChild, "Elements in shadow insertioin point should be projected into content insertion points.");
// Remove child of ShadowRoot and check that projected node is removed from insertion point.
-firstShadow.removeChild(firstShadow.firstChild);
+firstShadow.firstChild.remove();
is(firstContent.getDistributedNodes().length, 0, "Reprojected element was removed from ShadowRoot, thus it should be removed from content insertion point.");
@@ -135,7 +135,7 @@ host.innerHTML = '';
is(firstContent.getDistributedNodes()[0], host.firstChild, "Child of host should be projected to insertion point.");
// Remove node and make sure that it is removed from distributed nodes.
-host.removeChild(host.firstChild);
+host.firstChild.remove();
is(firstContent.getDistributedNodes().length, 0, "Node removed from host should be removed from insertion point.");
diff --git a/dom/xslt/tests/mochitest/test_bug319374.xhtml b/dom/xslt/tests/mochitest/test_bug319374.xhtml
index 2342b3447419..b752c5e4eed1 100644
--- a/dom/xslt/tests/mochitest/test_bug319374.xhtml
+++ b/dom/xslt/tests/mochitest/test_bug319374.xhtml
@@ -45,7 +45,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=319374
while (res = result.iterateNext()) {
++counter;
var anon = getAnonymousNodes(res);
- anon[0].removeChild(anon[0].firstChild); // Removing a child node
+ anon[0].firstChild.remove(); // Removing a child node
anon[0].removeAttribute("attr1"); // Removing an attribute
anon[1].firstChild.data = "anon text changed" // Modifying text data
}
diff --git a/dom/xul/templates/tests/chrome/test_sortservice.xul b/dom/xul/templates/tests/chrome/test_sortservice.xul
index af1de3f0ef36..b7d5848a1148 100644
--- a/dom/xul/templates/tests/chrome/test_sortservice.xul
+++ b/dom/xul/templates/tests/chrome/test_sortservice.xul
@@ -56,7 +56,7 @@ function doTests()
is(actual, test[2], "sorted step " + (t + 1));
while(box.hasChildNodes())
- box.removeChild(box.firstChild);
+ box.firstChild.remove();
box.removeAttribute("sortDirection");
}
diff --git a/dom/xul/test/test_bug311681.xul b/dom/xul/test/test_bug311681.xul
index 515bd67bf81d..9c22246c6268 100644
--- a/dom/xul/test/test_bug311681.xul
+++ b/dom/xul/test/test_bug311681.xul
@@ -81,7 +81,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=311681
function clear(node) {
while (node.hasChildNodes()) {
- node.removeChild(node.firstChild);
+ node.firstChild.remove();
}
}
diff --git a/editor/composer/crashtests/407062-1.html b/editor/composer/crashtests/407062-1.html
index 81083c235d53..9bd5d02e59e7 100644
--- a/editor/composer/crashtests/407062-1.html
+++ b/editor/composer/crashtests/407062-1.html
@@ -7,7 +7,7 @@ function boom()
{
var r = document.documentElement;
while(r.firstChild)
- r.removeChild(r.firstChild);
+ r.firstChild.remove();
document.execCommand("contentReadOnly", false, "");
document.documentElement.focus();
diff --git a/editor/libeditor/crashtests/1317718.html b/editor/libeditor/crashtests/1317718.html
index ecef30e0d909..892b8aee3127 100644
--- a/editor/libeditor/crashtests/1317718.html
+++ b/editor/libeditor/crashtests/1317718.html
@@ -4,7 +4,7 @@
addEventListener('DOMContentLoaded', function() {
let root = document.documentElement;
while(root.firstChild) {
- root.removeChild(root.firstChild);
+ root.firstChild.remove();
}
document.designMode = 'on';
document.removeChild(document.documentElement);
diff --git a/editor/libeditor/crashtests/1324505.html b/editor/libeditor/crashtests/1324505.html
index 2af15becc7c6..4872b9f05d99 100644
--- a/editor/libeditor/crashtests/1324505.html
+++ b/editor/libeditor/crashtests/1324505.html
@@ -4,7 +4,7 @@
addEventListener("DOMContentLoaded", function(){
let root = document.documentElement;
while(root.firstChild) {
- root.removeChild(root.firstChild);
+ root.firstChild.remove();
}
let o_0 = document.createElement("body");
root.appendChild(o_0);
diff --git a/editor/libeditor/crashtests/612565-1.html b/editor/libeditor/crashtests/612565-1.html
index 1b059aa6624c..8df4283f8da9 100644
--- a/editor/libeditor/crashtests/612565-1.html
+++ b/editor/libeditor/crashtests/612565-1.html
@@ -10,7 +10,7 @@
doc.body.appendChild(doc.createTextNode("foo"));
doc.designMode = "on";
while (doc.body.firstChild) {
- doc.body.removeChild(doc.body.firstChild);
+ doc.body.firstChild.remove();
}
};
diff --git a/editor/libeditor/crashtests/713427-2.xhtml b/editor/libeditor/crashtests/713427-2.xhtml
index 7ebfb7775af7..39ac18ed07e7 100644
--- a/editor/libeditor/crashtests/713427-2.xhtml
+++ b/editor/libeditor/crashtests/713427-2.xhtml
@@ -6,7 +6,7 @@
function boom()
{
while (document.documentElement.firstChild) {
- document.documentElement.removeChild(document.documentElement.firstChild);
+ document.documentElement.firstChild.remove();
}
var td = document.createElementNS("http://www.w3.org/1999/xhtml", "td");
diff --git a/editor/libeditor/crashtests/761861.html b/editor/libeditor/crashtests/761861.html
index 0c1f3f521056..2a7e06a15491 100644
--- a/editor/libeditor/crashtests/761861.html
+++ b/editor/libeditor/crashtests/761861.html
@@ -3,7 +3,7 @@
function boom() {
var r = document.documentElement;
while (r.firstChild) {
- r.removeChild(r.firstChild);
+ r.firstChild.remove();
}
document.documentElement.contentEditable = "true";
diff --git a/editor/libeditor/crashtests/766413.html b/editor/libeditor/crashtests/766413.html
index c5d9835e3ca7..1a7092d92a0a 100644
--- a/editor/libeditor/crashtests/766413.html
+++ b/editor/libeditor/crashtests/766413.html
@@ -7,7 +7,7 @@ function boom()
{
var root = document.documentElement;
while (root.firstChild) {
- root.removeChild(root.firstChild);
+ root.firstChild.remove();
}
var space = document.createTextNode(" ");
diff --git a/editor/libeditor/crashtests/767169.html b/editor/libeditor/crashtests/767169.html
index 3dfad160c1c6..a7673bce62bf 100644
--- a/editor/libeditor/crashtests/767169.html
+++ b/editor/libeditor/crashtests/767169.html
@@ -7,7 +7,7 @@
function boom()
{
var root = document.documentElement;
- while (root.firstChild) { root.removeChild(root.firstChild); }
+ while (root.firstChild) { root.firstChild.remove(); }
root.contentEditable = "true";
document.removeChild(root);
document.appendChild(root);
diff --git a/editor/libeditor/crashtests/768765.html b/editor/libeditor/crashtests/768765.html
index 060e5161bd08..551e4ec6c380 100644
--- a/editor/libeditor/crashtests/768765.html
+++ b/editor/libeditor/crashtests/768765.html
@@ -7,7 +7,7 @@ function boom()
{
var root = document.documentElement;
- while (root.firstChild) { root.removeChild(root.firstChild); }
+ while (root.firstChild) { root.firstChild.remove(); }
var body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
var div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
diff --git a/editor/libeditor/crashtests/772282.html b/editor/libeditor/crashtests/772282.html
index f6259b344cf7..bba3d6bd6733 100644
--- a/editor/libeditor/crashtests/772282.html
+++ b/editor/libeditor/crashtests/772282.html
@@ -6,7 +6,7 @@
function boom()
{
var root = document.documentElement;
- while(root.firstChild) { root.removeChild(root.firstChild); }
+ while(root.firstChild) { root.firstChild.remove(); }
var body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
body.setAttributeNS(null, "contenteditable", "true");
var img = document.createElementNS("http://www.w3.org/1999/xhtml", "img");
diff --git a/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/static/js/range.js b/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/static/js/range.js
index 86ba6e1716f0..e6bfa84ba5a1 100644
--- a/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/static/js/range.js
+++ b/editor/libeditor/tests/browserscope/lib/richtext2/richtext2/static/js/range.js
@@ -2109,7 +2109,7 @@ goog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) {
totalHtml.push("");
var elem = doc.createElement(goog.dom.TagName.DIV);
elem.innerHTML = totalHtml.join("");
- return elem.removeChild(elem.firstChild)
+ return elem.firstChild.remove()
};
goog.dom.htmlToDocumentFragment = function(htmlString) {
return goog.dom.htmlToDocumentFragment_(document, htmlString)
@@ -2118,12 +2118,12 @@ goog.dom.htmlToDocumentFragment_ = function(doc, htmlString) {
var tempDiv = doc.createElement("div");
if(goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT) {
tempDiv.innerHTML = "
" + htmlString;
- tempDiv.removeChild(tempDiv.firstChild)
+ tempDiv.firstChild.remove()
}else {
tempDiv.innerHTML = htmlString
}
if(tempDiv.childNodes.length == 1) {
- return tempDiv.removeChild(tempDiv.firstChild)
+ return tempDiv.firstChild.remove()
}else {
var fragment = doc.createDocumentFragment();
while(tempDiv.firstChild) {
diff --git a/editor/libeditor/tests/file_select_all_without_body.html b/editor/libeditor/tests/file_select_all_without_body.html
index 70050a847409..3389538313d3 100644
--- a/editor/libeditor/tests/file_select_all_without_body.html
+++ b/editor/libeditor/tests/file_select_all_without_body.html
@@ -16,7 +16,7 @@ function boom()
{
var root = document.documentElement;
while(root.firstChild) {
- root.removeChild(root.firstChild);
+ root.firstChild.remove();
}
root.appendChild(document.createTextNode("Mozilla"));
root.focus();
diff --git a/editor/libeditor/tests/test_bug612447.html b/editor/libeditor/tests/test_bug612447.html
index b06739288419..cdb9b22f1e1a 100644
--- a/editor/libeditor/tests/test_bug612447.html
+++ b/editor/libeditor/tests/test_bug612447.html
@@ -44,7 +44,7 @@ SimpleTest.waitForFocus(function() {
var beforeB = snapshotWindow(win, true);
is(b.textContent, "X", "Typing should work");
while (b.firstChild) {
- b.removeChild(b.firstChild);
+ b.firstChild.remove();
}
ok(editorCommandsEnabled(), "The editor commands should work");
@@ -58,7 +58,7 @@ SimpleTest.waitForFocus(function() {
var afterB = snapshotWindow(win, true);
is(b.textContent, "X", "Typing should work");
while (b.firstChild) {
- b.removeChild(b.firstChild);
+ b.firstChild.remove();
}
ok(editorCommandsEnabled(), "The editor commands should work");
diff --git a/gfx/tests/crashtests/595727-1.html b/gfx/tests/crashtests/595727-1.html
index 13b048f8226d..d2012c715395 100644
--- a/gfx/tests/crashtests/595727-1.html
+++ b/gfx/tests/crashtests/595727-1.html
@@ -6,7 +6,7 @@
function doTest()
{
var r = document.documentElement;
- while(r.firstChild) { r.removeChild(r.firstChild); }
+ while(r.firstChild) { r.firstChild.remove(); }
var body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
r.appendChild(body);
body.contentEditable = "true";
diff --git a/layout/base/crashtests/372550-1.html b/layout/base/crashtests/372550-1.html
index a1dd8ea5b8b9..778652f0b52b 100644
--- a/layout/base/crashtests/372550-1.html
+++ b/layout/base/crashtests/372550-1.html
@@ -11,7 +11,7 @@
document.body.offsetWidth;
var div = document.getElementById("x");
div.id = "y";
- div.removeChild(div.firstChild);
+ div.firstChild.remove();