Closed Bug 739531 Opened 12 years ago Closed 12 years ago

Can't duplicate a tab with designMode and no body

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 15

People

(Reporter: pauly, Assigned: zpao)

References

()

Details

(Whiteboard: [fixed-in-fx-team])

Attachments

(2 files)

STR:
1. Open https://bug713417.bugzilla.mozilla.org/attachment.cgi?id=584240
2. Try to duplicate the tab (hold CTRL key and drag the tab to the right)

Actual results:
Nothing happens

Expected results:
The tab should duplicate

Note:
Reproducible on FF 14 (2012-03-26) on all platforms
The error console shows:

Error: uncaught exception: [Exception... "'[JavaScript Error: "aContent.document.body is null" {file: "resource:///components/nsSessionStore.js" line: 2176}]' when calling method: [nsISessionStore::duplicateTab]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://browser/content/tabbrowser.xml :: duplicateTab :: line 2189"  data: yes]

http://hg.mozilla.org/mozilla-central/annotate/a30fd69f1e0c/browser/components/sessionstore/src/nsSessionStore.js#l2193 assumes the document has a body element, and throws when the assumption doesn't hold.

(To reproduce on Mac, hold Option rather than Ctrl.)
Summary: Duplicate tabs doesn't always work → Can't duplicate a tab with designMode and no body
Version: 12 Branch → Trunk
Attached patch Patch v0.1Splinter Review
This does the trick. I covered both ends - saving & restoring - in case we do save data & try to restore into a document we no longer can.
Assignee: nobody → paul
Attachment #609890 - Flags: review?(dietrich)
Comment on attachment 609890 [details] [diff] [review]
Patch v0.1

Review of attachment 609890 [details] [diff] [review]:
-----------------------------------------------------------------

looks good. should be easily testable, will r+ with that.
Attachment #609890 - Flags: review?(dietrich) → feedback+
Attached patch Patch v0.2Splinter Review
Cleaning out my assigned bugs and this was easy enough to finish up.
Attachment #626593 - Flags: review?(ttaubert)
Attachment #626593 - Flags: review?(ttaubert) → review+
https://hg.mozilla.org/integration/fx-team/rev/41fdd17ee9d3
Status: NEW → ASSIGNED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 15
https://hg.mozilla.org/mozilla-central/rev/41fdd17ee9d3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Duplication works ok now. Verified fixed on FF 15.0a1 (2012-05-27) on Win 7, Ubuntu 12.04 and Mac OS X 10.6.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: