Unpin all tabs earlier when restoring a session in overwriting mode

RESOLVED FIXED in Firefox 9

Status

()

Firefox
Session Restore
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: ithinc, Assigned: ithinc)

Tracking

Trunk
Firefox 9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.1) Gecko/20100101 Firefox/6.0.1
Build ID: 20110830092941

Steps to reproduce:

http://mxr.mozilla.org/mozilla-central/source/browser/components/sessionstore/src/nsSessionStore.js#2603

2604     // make sure that the selected tab won't be closed in order to
2605     // prevent unnecessary flickering
2606     if (aOverwriteTabs && tabbrowser.selectedTab._tPos >= newTabCount)
2607       tabbrowser.moveTabTo(tabbrowser.selectedTab, newTabCount - 1);
2608 
2609     // unpin all tabs to ensure they are not reordered in the next loop
2610     if (aOverwriteTabs) {
2611       for (let t = tabbrowser._numPinnedTabs - 1; t > -1; t--)
2612         tabbrowser.unpinTab(tabbrowser.tabs[t]);
2613     }




Expected results:

These two paragraphs need to be swapped, because the former moveTabTo cannot move an unpinned tab before a pinned tab, thus the purpose to prevent unnecessary flickering is missed.
OS: Windows XP → All
Hardware: x86 → All
(Assignee)

Comment 1

6 years ago
Created attachment 560709 [details] [diff] [review]
patch
Attachment #560709 - Flags: review?(dietrich)

Updated

6 years ago
Assignee: nobody → ithinc
Comment on attachment 560709 [details] [diff] [review]
patch

hah, nice catch. r=me, assuming you've run the test suite or have try results showing no regressions from this.
Attachment #560709 - Flags: review?(dietrich) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed

Updated

6 years ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Comment 3

6 years ago
Didn't apply cleanly to inbound tip, but have fixed locally to save a back and forth. Now in my queue with a few other bits that are being sent to try first and then onto inbound.

To save time for future patches, could you set your hgrc to include the author automatically & also add a commit message, along the lines of:
http://blog.bonardo.net/2010/06/22/so-youre-about-to-use-checkin-needed

Thanks :-)
Keywords: checkin-needed

Comment 4

6 years ago
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=87ba0b8cbf99

https://hg.mozilla.org/integration/mozilla-inbound/rev/154c98ef3947
Target Milestone: --- → Firefox 9

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/154c98ef3947
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.