Closed Bug 299494 Opened 20 years ago Closed 20 years ago

Crash when designmode on, print preview and then dragging link

Categories

(Core :: DOM: Editor, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: mozeditor)

Details

(Keywords: testcase)

Attachments

(2 files)

See upcoming testcase. After step 4 I crash, but I would not expect to be able to drag a link, since I'm still in designMode (or I still should be).
Attached file testcase
reproduced with: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.9) Gecko/20050630 Firefox/1.0.5
So the crash happens because print preview wipes out the old presshell in most cases (unless there are framesets or embeds or applets in it, see nsPrintEngine::CheckDocumentForPPCaching()). This fails for <object>, of course, and messes up this case. Is there a reason not to just always cache here? In any case, the presshell dies but the editor doesn't know that, and some editor code holds a weak ref to the shell that becomes bogus. I'll attach a patch for that; with that patch I don't crash, but designmode isn't really working right either when I exit print preview. Maybe that should be a separate bug...
OS: Windows XP → All
Hardware: PC → All
Attached patch Fix the crashSplinter Review
Both the editor and caret hold an nsWeakPtr, so this code should do the same...
Attachment #188505 - Flags: superreview?(jst)
Attachment #188505 - Flags: review?(brade)
Comment on attachment 188505 [details] [diff] [review] Fix the crash sr=jst
Attachment #188505 - Flags: superreview?(jst) → superreview+
Comment on attachment 188505 [details] [diff] [review] Fix the crash r=brade
Attachment #188505 - Flags: review?(brade) → review+
Comment on attachment 188505 [details] [diff] [review] Fix the crash Requesting 1.8b3 approval for this crash fix. This is quite safe.
Attachment #188505 - Flags: approval1.8b3?
Attachment #188505 - Flags: approval1.8b3? → approval1.8b3+
Bug 300165 filed for the remaining issues here, and fix checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: