Closed Bug 246409 Opened 20 years ago Closed 5 years ago

NS_KEY_PRESS events should always have a keyCode

Categories

(Core :: DOM: Events, defect, P5)

Other
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1479964

People

(Reporter: ilya.konstantinov+future, Unassigned)

References

Details

(Whiteboard: [WONTFIX?])

Attachments

(2 files, 1 obsolete file)

Currently, we don't set the keyCode for keypress events which have a charCode. This was done to solve bug 13447, but no longer seems required (I reversed the fix, and Delete/Backspace keys work as usual). Solving this bug would improve also improve our IE compatibility. (Our proprietary KeyEvent object is modeled on IE's.)
Attached patch Fix for gtk (obsolete) — Splinter Review
Attachment #150565 - Flags: superreview?(jst)
Attachment #150565 - Flags: review?(bryner)
Attached file Testcase
gtk and gtk2 patches were tested by me. windows patch was tested by jst. macos patch is a "blind patch"; a mac developer should test it.
Assignee: general → mozilla-bugzilla
Attachment #150565 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #150565 - Flags: superreview?(jst)
Attachment #150565 - Flags: review?(bryner)
Hmm, I can't believe I didn't notice this the first time I tested windows version of this diff, but this change makes the '.' key not work as expected in input fields. If you apply this diff, start Firefox and start typing in the URL bar, no '.'s show up when you hit the '.' key. And if you position the cursor in the middle of some existing text, hittin the '.' key acts as if you've hit the 'Del' key! Any thoughts?
Also, this patch causes regression described by bug 250198 (on gtk2). I wonder why things are so sensitive to having keypresses without keyCode.
*** Bug 270612 has been marked as a duplicate of this bug. ***
Blocks: 351310
I think this might confuse existing scripts on some sites, so I'm leaning towards INVALID/WONTFIX. As mentioned in comment 2, DOM2 Events at one point required both keyCode and charCode for all keyup/down/press events, but the whole section on keyboard events were later removed. http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-keyevents Looking at "DOM Level 3 Events Specification" there is no "keypress" event, it seems to have been replaced by a "textInput" event and none of the events have keyCode/charCode, instead there is "keyIdentifier", "keyLocation" http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events-KeyboardEvent and "data" http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events-TextEvents-Interfaces I get the impression that WHATWG will not define its own keyboard events, but instead refers to DOM3 Events. http://www.whatwg.org/specs/web-apps/current-work/#events
Whiteboard: [WONTFIX?]
Product: Core → Core Graveyard
Assignee: mozilla-bugzilla → nobody
Component: GFX → DOM: Events
Product: Core Graveyard → Core
QA Contact: ian → events
Status: ASSIGNED → UNCONFIRMED
Ever confirmed: false
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: