зеркало из https://github.com/mozilla/pjs.git
Bug 520538 - -new-tab about:blank should focus the location bar. r=gavin
This commit is contained in:
Родитель
a2f1192ff6
Коммит
c215683685
|
@ -4520,6 +4520,13 @@ nsBrowserAccess.prototype = {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (isExternal && (!aURI || aURI.spec == "about:blank")) {
|
||||
win.BrowserOpenTab(); // this also focuses the location bar
|
||||
win.focus();
|
||||
newWindow = win.content;
|
||||
break;
|
||||
}
|
||||
|
||||
let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground");
|
||||
let referrer = aOpener ? makeURI(aOpener.location.href) : null;
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ _BROWSER_FILES = \
|
|||
browser_bug477014.js \
|
||||
browser_bug495058.js \
|
||||
browser_bug517902.js \
|
||||
browser_bug520538.js \
|
||||
browser_bug521216.js \
|
||||
browser_bug537474.js \
|
||||
browser_discovery.js \
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
function test() {
|
||||
var tabs = gBrowser.tabContainer.childElementCount;
|
||||
content.focus();
|
||||
browserDOMWindow.openURI(makeURI("about:blank"),
|
||||
null,
|
||||
Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
|
||||
Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
is(gBrowser.tabContainer.childElementCount, tabs + 1,
|
||||
"'-new-tab about:blank' opens a new tab");
|
||||
is(gBrowser.selectedTab, gBrowser.tabContainer.childNodes[tabs],
|
||||
"'-new-tab about:blank' selects the new tab");
|
||||
is(document.activeElement, gURLBar.inputField,
|
||||
"'-new-tab about:blank' focuses the location bar");
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
Загрузка…
Ссылка в новой задаче