зеркало из https://github.com/mozilla/gecko-dev.git
Bug 682507 - Expose browser restore state as a tab attribute to help style unloaded tabs. r=dietrich
This commit is contained in:
Родитель
ac8ccc1efe
Коммит
e4336a1e42
|
@ -4177,6 +4177,11 @@
|
|||
aMenuitem.removeAttribute("busy");
|
||||
}
|
||||
|
||||
if (aTab.hasAttribute("pending"))
|
||||
aMenuitem.setAttribute("pending", aTab.getAttribute("pending"));
|
||||
else
|
||||
aMenuitem.removeAttribute("pending");
|
||||
|
||||
if (aTab.selected)
|
||||
aMenuitem.setAttribute("selected", "true");
|
||||
else
|
||||
|
|
|
@ -2825,6 +2825,7 @@ SessionStoreService.prototype = {
|
|||
// a tab gets closed before it's been properly restored
|
||||
browser.__SS_data = tabData;
|
||||
browser.__SS_restoreState = TAB_STATE_NEEDS_RESTORE;
|
||||
tab.setAttribute("pending", "true");
|
||||
|
||||
// Make sure that set/getTabValue will set/read the correct data by
|
||||
// wiping out any current value in tab.__SS_extdata.
|
||||
|
@ -3007,6 +3008,7 @@ SessionStoreService.prototype = {
|
|||
|
||||
// Set this tab's state to restoring
|
||||
browser.__SS_restoreState = TAB_STATE_RESTORING;
|
||||
aTab.removeAttribute("pending");
|
||||
|
||||
// Remove the history listener, since we no longer need it once we start restoring
|
||||
this._removeSHistoryListener(aTab);
|
||||
|
|
|
@ -152,6 +152,7 @@ _BROWSER_TEST_FILES = \
|
|||
browser_645428.js \
|
||||
browser_659591.js \
|
||||
browser_662812.js \
|
||||
browser_682507.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_ARCH),Darwin)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("browser.sessionstore.restore_on_demand", true);
|
||||
gBrowser.addTab("about:mozilla");
|
||||
|
||||
ss.setTabState(gBrowser.tabs[1], ss.getTabState(gBrowser.tabs[1]));
|
||||
ok(gBrowser.tabs[1].hasAttribute("pending"), "second tab should have 'pending' attribute");
|
||||
|
||||
gBrowser.selectedTab = gBrowser.tabs[1];
|
||||
ok(!gBrowser.tabs[1].hasAttribute("pending"), "second tab should have not 'pending' attribute");
|
||||
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand");
|
||||
}
|
Загрузка…
Ссылка в новой задаче