Closed Bug 66742 Opened 24 years ago Closed 23 years ago

[pp]Application crashes after closing a onkeydown event dialog

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

PowerPC
Mac System 9.x
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: chrispetersen, Assigned: joki)

References

()

Details

(Keywords: crash, platform-parity)

Attachments

(4 files)

Build: 2001012611 Platform: Mac only Expected Results: Closing dialog should not crash the application. What I got: Event handler is processed and dialog is displayed. Closin the dilaog causes the crash. Steps to reproduce: 1) Open http://slip/projects/marvin/html/a_onkeydown.html 2) Place focus on link by mousing down on it. Press a key on the keyboard. 3) The event onkeydown will be processed. Mouse up to remove focus off link. 4) Close the alert dialog. A crash should occur.
Summary: Application crashes after closing a onkeydown event dialog → [pp]Application crashes after closing a onkeydown event dialog
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok
I'm gonna need some Mac help on this one. I'll set milestone to 0.9.1 since its a crash and see if we can get it taken care of.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
nominating for dogfood (from sdagley's list of bugs that are good candidates for our next release)
Keywords: nsdogfood
Keywords: nsCatFood
Keywords: nsdogfood
There is a javascript code that should open the Alert dialog box. But, this dialog is not opened.
Severity: normal → major
Keywords: crash
Looks good to me. r=joki
The attached patch fixes two problems. First, it ensures that a keypress event goes to the same widget/window that the keydown event goes to. (note: joki says it's ok if the keyup goes to a different window) Second, this patch ensures that we don't use a focused widget which might have been closed (and therefore deleted which could lead to a crash). It does this by relying on a 2nd call to gEventDispatchHandler.GetActive() to not return a bad window/widget.
sr=sfraser if you fix the spacing.
spacing adjusted to match code immediately around it; fix checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: pp
Resolution: --- → FIXED
This change does not build under gcc on Mac OSX: nsMacEventHandler.cpp: In method `PRBool nsMacEventHandler::HandleKeyEvent(EventRecord &)': nsMacEventHandler.cpp:1075: jump to case label nsMacEventHandler.cpp:1060: crosses initialization of `class nsWindow * checkFocusedWidget' You need to move the declaration of checkFocusedWidget to a better place.
Dave Alverson--could you please apply a patch or a code snippet that does compile?
new patch checked in; thanks!
Tested bug on win2000 BuildID: 2001061304 and macOS 8.6 BuildID:2001061308 The crash does not occur anymore. Marking bug as verified.
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: