Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit fb03a6d

Browse files
committed
Backed out changeset 59c8fffe9e41 (bug 1442694)
1 parent 9d42077 commit fb03a6d

File tree

5 files changed

+22
-112
lines changed

5 files changed

+22
-112
lines changed

browser/base/content/tabbrowser.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
display: none;
2323
}
2424

25-
.tab-icon-pending[preopened],
26-
.tab-icon-image[preopened] {
27-
visibility: hidden;
28-
}
29-
3025
.tab-sharing-icon-overlay[sharing]:not([selected]),
3126
.tab-icon-overlay[soundplaying][pinned],
3227
.tab-icon-overlay[muted][pinned],

browser/base/content/tabbrowser.js

Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ window._gBrowser = {
3232
window.addEventListener("occlusionstatechange", this);
3333

3434
this._setupInitialBrowserAndTab();
35-
this._preopenPinnedTabs();
3635

3736
if (Services.prefs.getBoolPref("browser.display.use_system_colors")) {
3837
this.tabpanels.style.backgroundColor = "-moz-default-background-color";
@@ -384,31 +383,6 @@ window._gBrowser = {
384383
browser.webProgress.addProgressListener(filter, Ci.nsIWebProgress.NOTIFY_ALL);
385384
},
386385

387-
_preopenPinnedTabs() {
388-
let numPinnedTabs = 0;
389-
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
390-
let windows = browserWindows();
391-
windows.getNext();
392-
let isOnlyWindow = !windows.hasMoreElements();
393-
if (isOnlyWindow) {
394-
numPinnedTabs = Services.prefs.getIntPref("browser.tabs.firstWindowRestore.numPinnedTabs", 0);
395-
}
396-
}
397-
398-
for (let i = 0; i < numPinnedTabs; i++) {
399-
let tab = this.addTrustedTab("about:blank", {
400-
skipAnimation: true,
401-
noInitialLabel: true,
402-
skipBackgroundNotify: true,
403-
createLazyBrowser: true,
404-
pinned: true,
405-
isForFirstWindowRestore: true,
406-
});
407-
408-
tab.setAttribute("preopened", "true");
409-
}
410-
},
411-
412386
/**
413387
* BEGIN FORWARDED BROWSER PROPERTIES. IF YOU ADD A PROPERTY TO THE BROWSER ELEMENT
414388
* MAKE SURE TO ADD IT HERE AS WELL.
@@ -619,33 +593,14 @@ window._gBrowser = {
619593
this.tabContainer._updateCloseButtons();
620594
},
621595

622-
_sendPinnedTabContentMessage(aTab) {
596+
_notifyPinnedStatus(aTab) {
623597
this.getBrowserForTab(aTab).messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: aTab.pinned });
624-
},
625-
626-
_notifyPinnedStatus(aTab, aDeferContentMessage = false) {
627-
if (!aDeferContentMessage) {
628-
this._sendPinnedTabContentMessage(aTab);
629-
}
630598

631599
let event = document.createEvent("Events");
632600
event.initEvent(aTab.pinned ? "TabPinned" : "TabUnpinned", true, false);
633601
aTab.dispatchEvent(event);
634602
},
635603

636-
_maybeUpdateNumPinnedTabsPref() {
637-
if (!PrivateBrowsingUtils.isWindowPrivate(window) &&
638-
BrowserWindowTracker.getTopWindow() == window) {
639-
Services.prefs.setIntPref("browser.tabs.firstWindowRestore.numPinnedTabs",
640-
this._numPinnedTabs);
641-
}
642-
},
643-
644-
activatePreopenedPinnedTab(aTab) {
645-
this._insertBrowser(aTab);
646-
this._sendPinnedTabContentMessage(aTab);
647-
},
648-
649604
pinTab(aTab) {
650605
if (aTab.pinned)
651606
return;
@@ -657,7 +612,6 @@ window._gBrowser = {
657612
aTab.setAttribute("pinned", "true");
658613
this._updateTabBarForPinnedTabs();
659614
this._notifyPinnedStatus(aTab);
660-
this._maybeUpdateNumPinnedTabsPref();
661615
},
662616

663617
unpinTab(aTab) {
@@ -669,7 +623,6 @@ window._gBrowser = {
669623
aTab.style.marginInlineStart = "";
670624
this._updateTabBarForPinnedTabs();
671625
this._notifyPinnedStatus(aTab);
672-
this._maybeUpdateNumPinnedTabsPref();
673626
},
674627

675628
previewTab(aTab, aCallback) {
@@ -2353,7 +2306,6 @@ window._gBrowser = {
23532306
forceNotRemote,
23542307
fromExternal,
23552308
index,
2356-
isForFirstWindowRestore,
23572309
lazyTabTitle,
23582310
name,
23592311
nextTabParentId,
@@ -2537,9 +2489,6 @@ window._gBrowser = {
25372489

25382490
if (pinned) {
25392491
this._updateTabBarForPinnedTabs();
2540-
if (!isForFirstWindowRestore) {
2541-
this._maybeUpdateNumPinnedTabsPref();
2542-
}
25432492
}
25442493
this.tabContainer._setPositionalAttributes();
25452494

@@ -2619,15 +2568,13 @@ window._gBrowser = {
26192568
userContextId);
26202569
b.registeredOpenURI = lazyBrowserURI;
26212570
}
2622-
if (!isForFirstWindowRestore) {
2623-
SessionStore.setTabState(t, {
2624-
entries: [{
2625-
url: lazyBrowserURI ? lazyBrowserURI.spec : "about:blank",
2626-
title: lazyTabTitle,
2627-
triggeringPrincipal_base64: E10SUtils.serializePrincipal(triggeringPrincipal),
2628-
}],
2629-
});
2630-
}
2571+
SessionStore.setTabState(t, {
2572+
entries: [{
2573+
url: lazyBrowserURI ? lazyBrowserURI.spec : "about:blank",
2574+
title: lazyTabTitle,
2575+
triggeringPrincipal_base64: E10SUtils.serializePrincipal(triggeringPrincipal),
2576+
}],
2577+
});
26312578
} else {
26322579
this._insertBrowser(t, true);
26332580
}
@@ -2665,9 +2612,7 @@ window._gBrowser = {
26652612

26662613
// If we didn't swap docShells with a preloaded browser
26672614
// then let's just continue loading the page normally.
2668-
if (!usingPreloadedContent &&
2669-
!createLazyBrowser &&
2670-
(!uriIsAboutBlank || !allowInheritPrincipal)) {
2615+
if (!usingPreloadedContent && (!uriIsAboutBlank || !allowInheritPrincipal)) {
26712616
// pretend the user typed this so it'll be available till
26722617
// the document successfully loads
26732618
if (aURI && !gInitialPages.includes(aURI)) {
@@ -2720,7 +2665,7 @@ window._gBrowser = {
27202665

27212666
// Additionally send pinned tab events
27222667
if (pinned) {
2723-
this._notifyPinnedStatus(t, isForFirstWindowRestore);
2668+
this._notifyPinnedStatus(t);
27242669
}
27252670

27262671
return t;
@@ -3218,10 +3163,8 @@ window._gBrowser = {
32183163
this.tabs[i]._tPos = i;
32193164

32203165
if (!this._windowIsClosing) {
3221-
if (wasPinned) {
3166+
if (wasPinned)
32223167
this.tabContainer._positionPinnedTabs();
3223-
this._maybeUpdateNumPinnedTabsPref();
3224-
}
32253168

32263169
// update tab close buttons state
32273170
this.tabContainer._updateCloseButtons();
@@ -3894,6 +3837,7 @@ window._gBrowser = {
38943837
skipAnimation: true,
38953838
index: aIndex,
38963839
createLazyBrowser,
3840+
allowInheritPrincipal: createLazyBrowser,
38973841
};
38983842

38993843
let numPinned = this._numPinnedTabs;
@@ -5070,7 +5014,6 @@ class TabProgressListener {
50705014
this.mTab.removeAttribute("crashed");
50715015
}
50725016

5073-
this.mTab.removeAttribute("preopened");
50745017
if (this._shouldShowProgress(aRequest)) {
50755018
if (!(aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING) &&
50765019
aWebProgress && aWebProgress.isTopLevel) {

browser/base/content/tabbrowser.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,10 +1937,10 @@
19371937
anonid="tab-throbber"
19381938
class="tab-throbber"
19391939
layer="true"/>
1940-
<xul:hbox xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected,pendingicon,preopened"
1940+
<xul:hbox xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected,pendingicon"
19411941
anonid="tab-icon-pending"
19421942
class="tab-icon-pending"/>
1943-
<xul:image xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing,preopened"
1943+
<xul:image xbl:inherits="src=image,triggeringprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
19441944
anonid="tab-icon-image"
19451945
class="tab-icon-image"
19461946
validate="never"

browser/components/sessionstore/SessionStore.jsm

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ var SessionStoreInternal = {
731731
this._prefBranch.addObserver("sessionstore.max_windows_undo", this, true);
732732

733733
this._restore_on_demand = this._prefBranch.getBoolPref("sessionstore.restore_on_demand");
734-
this._restore_pinned_tabs_on_demand = this._prefBranch.getBoolPref("sessionstore.restore_pinned_tabs_on_demand");
735734
this._prefBranch.addObserver("sessionstore.restore_on_demand", this, true);
736735

737736
gResistFingerprintingEnabled = Services.prefs.getBoolPref("privacy.resistFingerprinting");
@@ -3204,7 +3203,6 @@ var SessionStoreInternal = {
32043203
if (!uriObj || (uriObj && !window.gBrowser.isLocalAboutURI(uriObj))) {
32053204
tab.setAttribute("busy", "true");
32063205
}
3207-
tab.removeAttribute("preopened");
32083206

32093207
// Hack to ensure that the about:home, about:newtab, and about:welcome
32103208
// favicon is loaded instantaneously, to avoid flickering and improve
@@ -3652,19 +3650,16 @@ var SessionStoreInternal = {
36523650

36533651
// We need to keep track of the initially open tabs so that they
36543652
// can be moved to the end of the restored tabs.
3655-
let initialTabs = [];
3653+
let initialTabs;
36563654
if (!overwriteTabs && firstWindow) {
36573655
initialTabs = Array.slice(tabbrowser.tabs);
36583656
}
36593657

36603658
// Get rid of tabs that aren't needed anymore.
36613659
if (overwriteTabs) {
36623660
for (let i = tabbrowser.browsers.length - 1; i >= 0; i--) {
3663-
if (!tabbrowser.tabs[i].selected &&
3664-
!tabbrowser.tabs[i].hasAttribute("preopened")) {
3661+
if (!tabbrowser.tabs[i].selected) {
36653662
tabbrowser.removeTab(tabbrowser.tabs[i]);
3666-
} else if (tabbrowser.tabs[i].hasAttribute("preopened")) {
3667-
initialTabs.push(tabbrowser.tabs[i]);
36683663
}
36693664
}
36703665
}
@@ -3683,24 +3678,13 @@ var SessionStoreInternal = {
36833678
if (select &&
36843679
tabbrowser.selectedTab.userContextId == userContextId) {
36853680
tab = tabbrowser.selectedTab;
3686-
if (tab.pinned && !tabData.pinned) {
3681+
if (!tabData.pinned) {
36873682
tabbrowser.unpinTab(tab);
3688-
} else if (!tab.pinned && tabData.pinned) {
3689-
tabbrowser.removeTab(tabbrowser.tabs[t]);
3690-
tabbrowser.pinTab(tab);
3691-
tabbrowser.moveTabTo(tab, t);
36923683
}
3693-
36943684
tabbrowser.moveTabToEnd();
36953685
if (aWindow.gMultiProcessBrowser && !tab.linkedBrowser.isRemoteBrowser) {
36963686
tabbrowser.updateBrowserRemoteness(tab.linkedBrowser, true);
36973687
}
3698-
} else if (tabData.pinned &&
3699-
tabbrowser.tabs[t] &&
3700-
tabbrowser.tabs[t].pinned &&
3701-
!tabbrowser.tabs[t].linkedPanel) {
3702-
tab = tabbrowser.tabs[t];
3703-
tabbrowser.activatePreopenedPinnedTab(tab);
37043688
}
37053689

37063690
// Add a new tab if needed.
@@ -3749,14 +3733,11 @@ var SessionStoreInternal = {
37493733
}
37503734

37513735
// Move the originally open tabs to the end.
3752-
let endPosition = tabbrowser.tabs.length - 1;
3753-
for (let tab of initialTabs) {
3754-
if (tab.hasAttribute("preopened") &&
3755-
!tab.linkedPanel) {
3756-
tabbrowser.removeTab(tab);
3757-
} else if (!tab.hasAttribute("preopened")) {
3758-
tabbrowser.unpinTab(tab);
3759-
tabbrowser.moveTabTo(tab, endPosition);
3736+
if (initialTabs) {
3737+
let endPosition = tabbrowser.tabs.length - 1;
3738+
for (let i = 0; i < initialTabs.length; i++) {
3739+
tabbrowser.unpinTab(initialTabs[i]);
3740+
tabbrowser.moveTabTo(initialTabs[i], endPosition);
37603741
}
37613742
}
37623743

@@ -4017,9 +3998,6 @@ var SessionStoreInternal = {
40173998
for (let t = 0; t < aTabs.length; t++) {
40183999
if (t != selectedIndex) {
40194000
this.restoreTab(aTabs[t], aTabData[t]);
4020-
if (this._restore_pinned_tabs_on_demand) {
4021-
aTabs[t].removeAttribute("preopened");
4022-
}
40234001
}
40244002
}
40254003
},

browser/modules/BrowserWindowTracker.jsm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ function _untrackWindowOrder(window) {
9696
_trackedWindows.splice(idx, 1);
9797
}
9898

99-
function _trackPinnedTabs(window) {
100-
Services.prefs.setIntPref("browser.tabs.firstWindowRestore.numPinnedTabs",
101-
window.gBrowser._numPinnedTabs);
102-
}
103-
10499
// Methods that impact a window. Put into single object for organization.
105100
var WindowHelper = {
106101
addWindow(window) {
@@ -143,7 +138,6 @@ var WindowHelper = {
143138

144139
_untrackWindowOrder(window);
145140
_trackWindowOrder(window);
146-
_trackPinnedTabs(window);
147141

148142
_updateCurrentContentOuterWindowID(window.gBrowser.selectedBrowser);
149143
},

0 commit comments

Comments
 (0)