Closed Bug 63692 Opened 24 years ago Closed 24 years ago

document.onmouseover fires KeyEvent

Categories

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

x86
Other
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 35377

People

(Reporter: martin.honnen, Assigned: joki)

Details

Attachments

(1 file)

Strangely the event object in document.onmouseover identifies itself as a KeyEvent object when it should be a MouseEvent object. <HTML> <HEAD> <SCRIPT> document.onmouseover = function (evt) { document.body.appendChild(document.createElement('BR')); document.body.appendChild(document.createTextNode(evt + ': ' + evt.type)); return true; } </SCRIPT> </HEAD> <BODY> <A HREF="http://www.kibo.com"> Kibology </A> </BODY> </HTML>
I briefly checked what could be causing this, but didn't find anything yet. However, I did find at least two places where we set the wrong eventStructType for events (these probably do not affect this bug): nsEventStateManager.cpp line 588 (should be NS_MOUSE_EVENT) nsHTMLButtonElement.cpp line 398 (should be NS_MOUSE_EVENT) These kinds of errors would probably go away if we made the events classes instead of structs with proper constructors and accessors.
This is at least related to, if not a dupe of, bug 35377 where a mousedown event reports its type as KeyEvent.
I believe this bug is found in nsJSKeyEvent.cpp (generated file). Both MouseEvent and KeyEvent use the same JSClass KeyEventClass, which defines the class name to be "KeyEvent". I am also certain this is a duplicate of bug 35377, marking as such *** This bug has been marked as a duplicate of 35377 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Yup. 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: