Bug 1348318 - Avoid toolbox.win.top with undocked toolboxes. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 17 Mar 2017 10:51:03 -0500
changeset 348319 d06ce06386adb22b15fcab20df4ed13a4ee6dc20
parent 348318 312bdabd35b80e14c52893f72915531e334017a3
child 348320 5f756281dc146040f0ec7e0b23bbec84239829fe
push id88187
push userarchaeopteryx@coole-files.de
push dateSat, 18 Mar 2017 15:27:00 +0000
treeherdermozilla-inbound@0b1d3324cffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1348318
milestone55.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 1348318 - Avoid toolbox.win.top with undocked toolboxes. r=ochameau `toolbox.win.top` is a bit suspect when we support undocked toolboxes, as this doesn't allow you to reach a browser window for the toolbox. Here we take a different approach that should work for all docking types. MozReview-Commit-ID: 5mlsp4OyZrc
devtools/client/framework/devtools-browser.js
--- a/devtools/client/framework/devtools-browser.js
+++ b/devtools/client/framework/devtools-browser.js
@@ -746,17 +746,17 @@ var gDevToolsBrowser = exports.gDevTools
     }
     gDevToolsBrowser._trackedBrowserWindows.delete(win);
     win.removeEventListener("unload", this);
 
     BrowserMenus.removeMenus(win.document);
 
     // Destroy toolboxes for closed window
     for (let [target, toolbox] of gDevTools._toolboxes) {
-      if (toolbox.win.top == win) {
+      if (target.tab && target.tab.ownerDocument.defaultView == win) {
         toolbox.destroy();
       }
     }
 
     // Destroy the Developer toolbar if it has been accessed
     let desc = Object.getOwnPropertyDescriptor(win, "DeveloperToolbar");
     if (desc && !desc.get) {
       win.DeveloperToolbar.destroy();