Bug 485237 - Use \!toolbar.visible instead of the chromehidden attribute existence to identify popups. r=gavin

This commit is contained in:
Dão Gottwald
2012-01-24 01:37:54 +01:00
parent 36a3713b84
commit 8e027cf8fd
3 changed files with 4 additions and 4 deletions

View File

@@ -5201,7 +5201,7 @@ nsBrowserAccess.prototype = {
let win, needToFocusWin;
// try the current window. if we're in a popup, fall back on the most recent browser window
if (!window.document.documentElement.getAttribute("chromehidden"))
if (window.toolbar.visible)
win = window;
else {
win = Cc["@mozilla.org/browser/browserglue;1"]

View File

@@ -56,7 +56,7 @@ function getTopWin(skipPopups) {
// whether it's the frontmost window, since commands can be executed in
// background windows (bug 626148).
if (top.document.documentElement.getAttribute("windowtype") == "navigator:browser" &&
(!skipPopups || !top.document.documentElement.getAttribute("chromehidden")))
(!skipPopups || top.toolbar.visible))
return top;
if (skipPopups) {
@@ -206,7 +206,7 @@ function openLinkIn(url, where, params) {
var w = getTopWin();
if ((where == "tab" || where == "tabshifted") &&
w && w.document.documentElement.getAttribute("chromehidden")) {
w && !w.toolbar.visible) {
w = getTopWin(true);
aRelatedToCurrent = false;
}

View File

@@ -1442,7 +1442,7 @@ BrowserGlue.prototype = {
getMostRecentBrowserWindow: function BG_getMostRecentBrowserWindow() {
function isFullBrowserWindow(win) {
return !win.closed &&
!win.document.documentElement.getAttribute("chromehidden");
win.toolbar.visible;
}
#ifdef BROKEN_WM_Z_ORDER