The default bug view has changed. See this FAQ.

Update signature of duplicateTabIn() stub to match match Firefox 4.0.

RESOLVED FIXED in seamonkey2.1b3

Status

SeaMonkey
Tabbed Browser
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Philip Chee, Assigned: Philip Chee)

Tracking

({regression})

Trunk
seamonkey2.1b3
regression

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

2.75 KB, patch
neil@parkwaycc.co.uk
: review+
Misak Khachatryan
: feedback+
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
duplicateTabIn() is the Firefox equivalent of our OpenSessionHistoryIn(). After I implemented a stub duplicateTabIn() for extension compatibility, Dao decided that our API was saner. This bug just updates our stub.
(Assignee)

Updated

6 years ago
Depends on: 595483
(Assignee)

Updated

6 years ago
Assignee: philip.chee → nobody
Component: General → Tabbed Browser
QA Contact: general → tabbed-browser
(Assignee)

Comment 1

6 years ago
Created attachment 514710 [details] [diff] [review]
Patch v1.0 inc SessionRestore fix.

>    duplicateTab: function sss_duplicateTab(aWindow, aTab, aDelta, aRelated) {
>      if (!aTab.ownerDocument || !aTab.ownerDocument.defaultView.__SSi ||
>          aWindow && !aWindow.getBrowser)
>        throw (Components.returnCode = Components.results.NS_ERROR_INVALID_ARG);
>  
>      var tabState = this._collectTabData(aTab, true);
>      var sourceWindow = aTab.ownerDocument.defaultView;
>      this._updateTextAndScrollDataForTab(sourceWindow, aTab.linkedBrowser, tabState, true);
> -    this._sendWindowStateEvent(aWindow, "Busy");
>      tabState.index += aDelta;
> +    tabState.index = Math.max(1, Math.min(tabState.index, tabState.entries.length));
>  
>      if (aWindow) {
> +      this._sendWindowStateEvent(aWindow, "Busy");

_sendWindowStateEvent falls over when aWindow is null. Introduced in:

http://hg.mozilla.org/comm-central/rev/c18dddea67de
Bug 633722 - Port Bug 615394 [Session Restore should notify when it is beginning and ending a restore]
Oops.
Assignee: nobody → philip.chee
Attachment #514710 - Flags: review?(neil)
Attachment #514710 - Flags: feedback?(misak.bugzilla)

Comment 2

6 years ago
Comment on attachment 514710 [details] [diff] [review]
Patch v1.0 inc SessionRestore fix.

Perhaps we should modify it to use current window if aWindow is null ...
Attachment #514710 - Flags: feedback?(misak.bugzilla) → feedback+

Comment 3

6 years ago
(In reply to comment #2)
> Perhaps we should modify it to use current window if aWindow is null ...
No, because in that case we're creating a new window, and therefore restoreWindow will call _sendWindowStateEvent on the new window for us, right?

Incidentally I notice that undo close tab calls _sendWindowStateEvent even when using the tabbrowser to restore the tab.

Updated

6 years ago
Attachment #514710 - Flags: review?(neil) → review+
(Assignee)

Comment 4

6 years ago
> > Perhaps we should modify it to use current window if aWindow is null ...
> No, because in that case we're creating a new window, and therefore
> restoreWindow will call _sendWindowStateEvent on the new window for us, right?
Also my reading of the code indicates that there should be a matching _sendWindowStateEvent(aWindow, "Ready") on the same window so it's no use sending only half of the notifications.
(Assignee)

Comment 5

6 years ago
Pushed to comm-central.
http://hg.mozilla.org/comm-central/rev/aa25d31c8221
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: regression
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1b3

Comment 6

6 years ago
Comment on attachment 514710 [details] [diff] [review]
Patch v1.0 inc SessionRestore fix.

>-  OpenSessionHistoryIn(aWhere, delta, aTab)
>+  OpenSessionHistoryIn(aWhere, aDelta, aTab)
[Bah, I failed to notice the missing semicolon]
(Assignee)

Comment 7

6 years ago
> [Bah, I failed to notice the missing semicolon]

Added semicolon:
http://hg.mozilla.org/comm-central/rev/8310d0fd89a6
You need to log in before you can comment on or make changes to this bug.