зеркало из https://github.com/mozilla/pjs.git
Bug 623768 - Pressing Backspace in Panorama causes last focused tab to navigate backwards; f=mitcho r=ian approval2.0=beltzner
This commit is contained in:
Родитель
8889f2b864
Коммит
95a437e9ef
|
@ -1032,6 +1032,10 @@ let UI = {
|
|||
// the / event handler for find bar is defined in the findbar.xml
|
||||
// binding. To keep things in its own module, we handle our slash here.
|
||||
self.enableSearch(event);
|
||||
} else if (event.keyCode == KeyEvent.DOM_VK_BACK_SPACE) {
|
||||
// prevent navigating backward in the selected tab's history
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -95,6 +95,7 @@ _BROWSER_FILES = \
|
|||
browser_tabview_bug619937.js \
|
||||
browser_tabview_bug622835.js \
|
||||
browser_tabview_bug622872.js \
|
||||
browser_tabview_bug623768.js \
|
||||
browser_tabview_bug624265.js \
|
||||
browser_tabview_bug624931.js \
|
||||
browser_tabview_bug624727.js \
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let newTab = gBrowser.loadOneTab("http://www.example.com/#1",
|
||||
{ inBackground: false });
|
||||
|
||||
// The executeSoon() call is really needed here because there's callback
|
||||
// waiting to be fired after gBrowser.loadOneTab(). After that the browser is
|
||||
// in a state where loadURI() will create a new entry in the session history
|
||||
// (that is vital for back/forward functionality).
|
||||
afterAllTabsLoaded(function() {
|
||||
executeSoon(function() {
|
||||
ok(!newTab.linkedBrowser.canGoBack,
|
||||
"Browser should not be able to go back in history");
|
||||
|
||||
newTab.linkedBrowser.loadURI("http://www.example.com/#2");
|
||||
|
||||
afterAllTabsLoaded(function() {
|
||||
ok(newTab.linkedBrowser.canGoBack,
|
||||
"Browser can go back in history after loading another URL");
|
||||
|
||||
showTabView(function() {
|
||||
let contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
|
||||
EventUtils.synthesizeKey("VK_BACK_SPACE", { type: "keyup" }, contentWindow);
|
||||
|
||||
// check after a delay
|
||||
executeSoon(function() {
|
||||
ok(newTab.linkedBrowser.canGoBack,
|
||||
"Browser can still go back in history");
|
||||
|
||||
hideTabView(function() {
|
||||
gBrowser.removeTab(newTab);
|
||||
finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче