Bug 499547, double click on bookmark in library not raising window, r=dao

This commit is contained in:
Neil Deakin 2009-06-24 13:12:31 -04:00
parent fc5a81de1e
commit 5e4fafdf7a
2 changed files with 18 additions and 6 deletions

View File

@ -242,17 +242,25 @@ function openUILinkIn( url, where, allowThirdPartyFixup, postData, referrerUrl )
loadInBackground = !loadInBackground;
// fall through
case "tab":
var browser = w.getBrowser();
let browser = w.getBrowser();
browser.loadOneTab(url, referrerUrl, null, postData, loadInBackground,
allowThirdPartyFixup || false);
break;
}
// Focus the content but don't raise the window, since the URI we just loaded
// may have resulted in a new frontmost window (e.g. "javascript:window.open('');").
var browser = w.getBrowserFromContentWindow(w.content);
if (browser)
browser.focus();
// If this window is active, focus the target window. Otherwise, focus the
// content but don't raise the window, since the URI we just loaded may have
// resulted in a new frontmost window (e.g. "javascript:window.open('');").
var fm = Components.classes["@mozilla.org/focus-manager;1"].
getService(Components.interfaces.nsIFocusManager);
if (window == fm.activeWindow) {
w.content.focus();
}
else {
let browser = w.getBrowserFromContentWindow(w.content);
if (browser)
browser.focus();
}
}
// Used as an onclick handler for UI elements with link-like behavior.

View File

@ -84,6 +84,10 @@ var gTabsListener = {
if (gCurrentTest.URIs.indexOf(spec) != -1 )
this._loadedURIs.push(spec);
var fm = Components.classes["@mozilla.org/focus-manager;1"].
getService(Components.interfaces.nsIFocusManager);
is(fm.activeWindow, gBrowser.ownerDocument.defaultView, "window made active");
if (this._loadedURIs.length == gCurrentTest.URIs.length) {
// We have correctly opened all URIs.