Bug 1446721: replacing parent.removeChild(child) with simpler child.remove; r=dao
authorConstantine Filin <constfilin@gmail.com>
Thu, 17 May 2018 00:10:28 -0700
changeset 418721 ed45b1e16efffebbd249784760b76b864847e1d5
parent 418720 77be4f72addfcadf5694d62f7c64248c5d9ceb46
child 418722 ad016230e0bdb2e6b069387abac1b3be5fcb1459
push id64122
push userdgottwald@mozilla.com
push dateThu, 17 May 2018 16:13:36 +0000
treeherderautoland@ed45b1e16eff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1446721
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446721: replacing parent.removeChild(child) with simpler child.remove; r=dao MozReview-Commit-ID: 3QUuiu3CVo5
browser/base/content/tabbrowser.js
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1614,17 +1614,17 @@ window._gBrowser = {
 
     // Make sure to restore the original droppedLinkHandler and
     // sameProcessAsFrameLoader.
     let droppedLinkHandler = aBrowser.droppedLinkHandler;
     let sameProcessAsFrameLoader = aBrowser.sameProcessAsFrameLoader;
 
     // Change the "remote" attribute.
     let parent = aBrowser.parentNode;
-    parent.removeChild(aBrowser);
+    aBrowser.remove();
     if (aShouldBeRemote) {
       aBrowser.setAttribute("remote", "true");
       aBrowser.setAttribute("remoteType", aOptions.remoteType);
     } else {
       aBrowser.setAttribute("remote", "false");
       aBrowser.removeAttribute("remoteType");
     }
 
@@ -2125,19 +2125,17 @@ window._gBrowser = {
     // Reset the findbar and remove it if it is attached to the tab.
     if (tab._findBar) {
       tab._findBar.close(true);
       tab._findBar.remove();
       delete tab._findBar;
     }
 
     aBrowser.destroy();
-
-    let notificationbox = this.getNotificationBox(aBrowser);
-    this.tabpanels.removeChild(notificationbox);
+    this.getNotificationBox(aBrowser).remove();
     tab.removeAttribute("linkedpanel");
 
     this._createLazyBrowser(tab);
 
     let evt = new CustomEvent("TabBrowserDiscarded", { bubbles: true });
     tab.dispatchEvent(evt);
   },
 
@@ -2921,17 +2919,17 @@ window._gBrowser = {
       // This has to happen before we remove the child so that the
       // XBL implementation of nsIObserver still works.
       browser.destroy();
     }
 
     var wasPinned = aTab.pinned;
 
     // Remove the tab ...
-    this.tabContainer.removeChild(aTab);
+    aTab.remove();
 
     // Update hashiddentabs if this tab was hidden.
     if (aTab.hidden)
       this.tabContainer._updateHiddenTabsStatus();
 
     // ... and fix up the _tPos properties immediately.
     for (let i = aTab._tPos; i < this.tabs.length; i++)
       this.tabs[i]._tPos = i;