Loading browser/base/content/browser-ctrlTab.js +2 −2 Original line number Diff line number Diff line Loading @@ -470,7 +470,7 @@ var ctrlTab = { handleEvent: function ctrlTab_handleEvent(event) { switch (event.type) { case "SSWindowStateReady": case "SSWindowRestored": this._initRecentlyUsedTabs(); break; case "TabAttrModified": Loading Loading @@ -531,7 +531,7 @@ var ctrlTab = { _init: function ctrlTab__init(enable) { var toggleEventListener = enable ? "addEventListener" : "removeEventListener"; window[toggleEventListener]("SSWindowStateReady", this, false); window[toggleEventListener]("SSWindowRestored", this, false); var tabContainer = gBrowser.tabContainer; tabContainer[toggleEventListener]("TabOpen", this, false); Loading browser/base/content/tabbrowser.xml +13 −7 Original line number Diff line number Diff line Loading @@ -1118,9 +1118,9 @@ if (!this._previewMode) { this._recordTabAccess(this.mCurrentTab); this.mCurrentTab.lastAccessed = Infinity; this.mCurrentTab.updateLastAccessed(); this.mCurrentTab.removeAttribute("unread"); oldTab.lastAccessed = Date.now(); oldTab.updateLastAccessed(); let oldFindBar = oldTab._findBar; if (oldFindBar && Loading Loading @@ -2020,7 +2020,6 @@ var position = this.tabs.length - 1; t._tPos = position; t.lastAccessed = Date.now(); t.permanentKey = {}; this.tabContainer._setPositionalAttributes(); Loading Loading @@ -4479,7 +4478,6 @@ this.mCurrentTab.permanentKey = this.mCurrentBrowser.permanentKey; this.mCurrentTab._tPos = 0; this.mCurrentTab._fullyOpen = true; this.mCurrentTab.lastAccessed = Infinity; this.mCurrentTab.cachePosition = 0; this.mCurrentTab.linkedBrowser = this.mCurrentBrowser; this.mCurrentTab.hasBrowser = true; Loading Loading @@ -6282,6 +6280,11 @@ </content> <implementation> <constructor><![CDATA[ if (!("_lastAccessed" in this)) { this.updateLastAccessed(); } ]]></constructor> <property name="_visuallySelected"> <setter> Loading Loading @@ -6357,10 +6360,13 @@ <getter> return this._lastAccessed == Infinity ? Date.now() : this._lastAccessed; </getter> <setter> this._lastAccessed = val; </setter> </property> <method name="updateLastAccessed"> <parameter name="aDate"/> <body><![CDATA[ this._lastAccessed = this.selected ? Infinity : (aDate || Date.now()); ]]></body> </method> <field name="cachePosition">Infinity</field> Loading browser/base/content/test/general/browser_ctrlTab.js +15 −8 Original line number Diff line number Diff line Loading @@ -41,10 +41,22 @@ add_task(function* () { checkTabs(3); yield ctrlTabTest([2, 1, 0], 7, 1); gBrowser.addTab(); { // test for bug 1292049 let tabToClose = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:buildconfig"); checkTabs(4); selectTabs([0, 1, 2, 3]); yield BrowserTestUtils.removeTab(tabToClose); checkTabs(3); undoCloseTab(); checkTabs(4); is(gBrowser.tabContainer.selectedIndex, 3, "tab is selected after closing and restoring it"); yield ctrlTabTest([], 1, 2); } { // test for bug 445369 checkTabs(4); selectTabs([1, 2, 0]); let selectedTab = gBrowser.selectedTab; Loading Loading @@ -127,12 +139,7 @@ add_task(function* () { } function checkTabs(aTabs) { var tabs = gBrowser.tabs.length; if (tabs != aTabs) { while (gBrowser.tabs.length > 1) gBrowser.removeCurrentTab(); throw "expected " + aTabs + " open tabs, got " + tabs; } is(gBrowser.tabs.length, aTabs, "number of open tabs should be " + aTabs); } function selectTabs(tabs) { Loading browser/components/sessionstore/SessionStore.jsm +14 −1 Original line number Diff line number Diff line Loading @@ -3073,6 +3073,8 @@ var SessionStoreInternal = { this._setWindowStateReady(aWindow); this._sendWindowRestoredNotification(aWindow); Services.obs.notifyObservers(aWindow, NOTIFY_SINGLE_WINDOW_RESTORED, ""); this._sendRestoreCompletedNotifications(); Loading Loading @@ -3255,7 +3257,7 @@ var SessionStoreInternal = { } if (tabData.lastAccessed) { tab.lastAccessed = tabData.lastAccessed; tab.updateLastAccessed(tabData.lastAccessed); } if ("attributes" in tabData) { Loading Loading @@ -4098,6 +4100,17 @@ var SessionStoreInternal = { aWindow.dispatchEvent(event); }, /** * Dispatch the SSWindowRestored event for the given window. * @param aWindow * The window which has been restored */ _sendWindowRestoredNotification(aWindow) { let event = aWindow.document.createEvent("Events"); event.initEvent("SSWindowRestored", true, false); aWindow.dispatchEvent(event); }, /** * Dispatch the SSTabRestored event for the given tab. * @param aTab Loading devtools/client/aboutdebugging/test/addons/bug1273184.xpi +3.87 KiB (4.15 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
browser/base/content/browser-ctrlTab.js +2 −2 Original line number Diff line number Diff line Loading @@ -470,7 +470,7 @@ var ctrlTab = { handleEvent: function ctrlTab_handleEvent(event) { switch (event.type) { case "SSWindowStateReady": case "SSWindowRestored": this._initRecentlyUsedTabs(); break; case "TabAttrModified": Loading Loading @@ -531,7 +531,7 @@ var ctrlTab = { _init: function ctrlTab__init(enable) { var toggleEventListener = enable ? "addEventListener" : "removeEventListener"; window[toggleEventListener]("SSWindowStateReady", this, false); window[toggleEventListener]("SSWindowRestored", this, false); var tabContainer = gBrowser.tabContainer; tabContainer[toggleEventListener]("TabOpen", this, false); Loading
browser/base/content/tabbrowser.xml +13 −7 Original line number Diff line number Diff line Loading @@ -1118,9 +1118,9 @@ if (!this._previewMode) { this._recordTabAccess(this.mCurrentTab); this.mCurrentTab.lastAccessed = Infinity; this.mCurrentTab.updateLastAccessed(); this.mCurrentTab.removeAttribute("unread"); oldTab.lastAccessed = Date.now(); oldTab.updateLastAccessed(); let oldFindBar = oldTab._findBar; if (oldFindBar && Loading Loading @@ -2020,7 +2020,6 @@ var position = this.tabs.length - 1; t._tPos = position; t.lastAccessed = Date.now(); t.permanentKey = {}; this.tabContainer._setPositionalAttributes(); Loading Loading @@ -4479,7 +4478,6 @@ this.mCurrentTab.permanentKey = this.mCurrentBrowser.permanentKey; this.mCurrentTab._tPos = 0; this.mCurrentTab._fullyOpen = true; this.mCurrentTab.lastAccessed = Infinity; this.mCurrentTab.cachePosition = 0; this.mCurrentTab.linkedBrowser = this.mCurrentBrowser; this.mCurrentTab.hasBrowser = true; Loading Loading @@ -6282,6 +6280,11 @@ </content> <implementation> <constructor><![CDATA[ if (!("_lastAccessed" in this)) { this.updateLastAccessed(); } ]]></constructor> <property name="_visuallySelected"> <setter> Loading Loading @@ -6357,10 +6360,13 @@ <getter> return this._lastAccessed == Infinity ? Date.now() : this._lastAccessed; </getter> <setter> this._lastAccessed = val; </setter> </property> <method name="updateLastAccessed"> <parameter name="aDate"/> <body><![CDATA[ this._lastAccessed = this.selected ? Infinity : (aDate || Date.now()); ]]></body> </method> <field name="cachePosition">Infinity</field> Loading
browser/base/content/test/general/browser_ctrlTab.js +15 −8 Original line number Diff line number Diff line Loading @@ -41,10 +41,22 @@ add_task(function* () { checkTabs(3); yield ctrlTabTest([2, 1, 0], 7, 1); gBrowser.addTab(); { // test for bug 1292049 let tabToClose = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:buildconfig"); checkTabs(4); selectTabs([0, 1, 2, 3]); yield BrowserTestUtils.removeTab(tabToClose); checkTabs(3); undoCloseTab(); checkTabs(4); is(gBrowser.tabContainer.selectedIndex, 3, "tab is selected after closing and restoring it"); yield ctrlTabTest([], 1, 2); } { // test for bug 445369 checkTabs(4); selectTabs([1, 2, 0]); let selectedTab = gBrowser.selectedTab; Loading Loading @@ -127,12 +139,7 @@ add_task(function* () { } function checkTabs(aTabs) { var tabs = gBrowser.tabs.length; if (tabs != aTabs) { while (gBrowser.tabs.length > 1) gBrowser.removeCurrentTab(); throw "expected " + aTabs + " open tabs, got " + tabs; } is(gBrowser.tabs.length, aTabs, "number of open tabs should be " + aTabs); } function selectTabs(tabs) { Loading
browser/components/sessionstore/SessionStore.jsm +14 −1 Original line number Diff line number Diff line Loading @@ -3073,6 +3073,8 @@ var SessionStoreInternal = { this._setWindowStateReady(aWindow); this._sendWindowRestoredNotification(aWindow); Services.obs.notifyObservers(aWindow, NOTIFY_SINGLE_WINDOW_RESTORED, ""); this._sendRestoreCompletedNotifications(); Loading Loading @@ -3255,7 +3257,7 @@ var SessionStoreInternal = { } if (tabData.lastAccessed) { tab.lastAccessed = tabData.lastAccessed; tab.updateLastAccessed(tabData.lastAccessed); } if ("attributes" in tabData) { Loading Loading @@ -4098,6 +4100,17 @@ var SessionStoreInternal = { aWindow.dispatchEvent(event); }, /** * Dispatch the SSWindowRestored event for the given window. * @param aWindow * The window which has been restored */ _sendWindowRestoredNotification(aWindow) { let event = aWindow.document.createEvent("Events"); event.initEvent("SSWindowRestored", true, false); aWindow.dispatchEvent(event); }, /** * Dispatch the SSTabRestored event for the given tab. * @param aTab Loading
devtools/client/aboutdebugging/test/addons/bug1273184.xpi +3.87 KiB (4.15 KiB) File changed.No diff preview for this file type. View original file View changed file