Closed Bug 636110 Opened 14 years ago Closed 14 years ago

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

Categories

(SeaMonkey :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.1b3

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

(Keywords: regression)

Attachments

(1 file)

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.
Depends on: 595483
Assignee: philip.chee → nobody
Component: General → Tabbed Browser
QA Contact: general → tabbed-browser
> 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 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+
(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.
Attachment #514710 - Flags: review?(neil) → review+
> > 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.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: regression
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1b3
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]
> [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.

Attachment

General

Creator:
Created:
Updated:
Size: