Closed Bug 345159 Opened 20 years ago Closed 20 years ago

Print/Preview crash with null root content [@ nsINode::IsInDoc] from [@ nsPrintEngine::MapContentToWebShells]

Categories

(Core :: Printing: Output, defect)

x86
Linux
defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(4 files, 1 obsolete file)

Print/Preview crash with null root content [@ nsINode::IsInDoc] from [@ nsPrintEngine::MapContentToWebShells] STEPS TO REPRODUCE 1. load the attached testcase 2. click on the button 3. select File->Print Preview => CRASH PLATFORMS AND BUILDS TESTED Bug occurs with SeaMonkey trunk debug build on Linux
Attached file Testcase —
Attached file stack —
document.removeChild(document.getElementsByTagName("*")[0]) This line remove the root content.
this also affects branches like Gecko/20060516 SeaMonkey/1.0.2
I have checked this page with IE. What IE do is to save this page to local and print. So a blank page will be printed. So what we should do here? The most easy way is to give out an error when there is no rootcontent.
Attached patch Patch rev. 1 (obsolete) — — Splinter Review
This patch makes us avoid sub-documents that does not have root content (but prints everything else). If the root document does not have content an error dialog is displayed. I re-used the following message: "Printing failed when starting the document." (I don't think it's worth the bloat to have a specific message for this rather extreme edge case).
Assignee: printing → mats.palmgren
Status: NEW → ASSIGNED
Attachment #230113 - Flags: superreview?(bzbarsky)
Attachment #230113 - Flags: review?(bzbarsky)
So.. Shouldn't we call CleanupOnFailure() instead of manually calling ShowPrintErrorDialog? I know the existing error handling is inconsistent; just not sure why... :(
Attached patch Patch rev. 2 — — Splinter Review
Using CleanupOnFailure()
Attachment #230113 - Attachment is obsolete: true
Attachment #230418 - Flags: superreview?(bzbarsky)
Attachment #230418 - Flags: review?(bzbarsky)
Attachment #230113 - Flags: superreview?(bzbarsky)
Attachment #230113 - Flags: review?(bzbarsky)
Comment on attachment 230418 [details] [diff] [review] Patch rev. 2 Looks great. r+sr=bzbarsky
Attachment #230418 - Flags: superreview?(bzbarsky)
Attachment #230418 - Flags: superreview+
Attachment #230418 - Flags: review?(bzbarsky)
Attachment #230418 - Flags: review+
Checked in to trunk at 2006-07-25 09:05 PDT. -> FIXED
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Although I get a "Printing failed when starting the document" error message when print previewing after clicking the button in https://bugzilla.mozilla.org/attachment.cgi?id=229787&action=view, neither it nor https://bugzilla.mozilla.org/attachment.cgi?id=230110&action=view crash any longer. (I think the error is valid--content has been removed--but what a generic error message; I'll have to see if there's a bug filed to make it nicer.) Verified FIXED using build 2006-07-27-09 of SeaMonkey trunk under Windows XP.
Status: RESOLVED → VERIFIED
Crash Signature: [@ nsINode::IsInDoc] [@ nsPrintEngine::MapContentToWebShells]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: