Closed Bug 1025982 Opened 8 years ago Closed 8 years ago

Pressing "Digit1" key results in "Digit0" KeyboardEvent.code value (and so on)


(Core :: DOM: Events, defect)

Windows 8.1
Not set



Tracking Status
firefox32 --- fixed
firefox33 --- fixed


(Reporter: sime.vidas, Assigned: masayuki)




(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140605174243

Steps to reproduce:

1. Use Firefox Nightly (I encountered this issue in version 33.0a1 (2014-06-16))
2. Open this demo:
3. Open the DevTools console
4. Click on the "Result" pane and then press the "1" key on your keyboard (the second key from the left in the top row, roughly above "Q")

Actual results:

The console logs "key = 1, code = Digit0".

Expected results:

The console should log "key = 1, code = Digit1". The spec defines that the second key from the left in the top row is "Digit1":
Component: Untriaged → DOM
Product: Firefox → Core
> The console logs "key = 1, code = Digit0".

I'm seeing "key = 1, code = Digit1" in a nightly, albeit on Mac.  Is this Windows-specific?
Flags: needinfo?(masayuki)
Oh, yes. This must be platform specific. However, I'll check it on other platforms too.

Thank you for the report!
Assignee: nobody → masayuki
Component: DOM → DOM: Events
Ever confirmed: true
Flags: needinfo?(masayuki)
Version: 33 Branch → Trunk
Attached patch PatchSplinter Review
Sorry for the mistake and not enough tested.
Attachment #8441229 - Flags: review?(jmathies)
Attachment #8441229 - Flags: review?(jmathies) → review+
I don't think that this should be uplift to Aurora because KeyboardEvent.code is disabled on release builds (Beta and Release) in default settings.

However, if smaug doesn't think so, let's request the approval.
Don't feel strongly about this. Approval wouldn't harm, but probably doesn't really matter.
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Comment on attachment 8441229 [details] [diff] [review]

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 865649
User impact if declined: User may show this strange mapping only on Windows. Although, KeyboardEvent.code is disabled by prefs in 32 release build. And I don't like to add a document about this mistake in MDN's compatibility table since it causes messy table.
Testing completed (on m-c, etc.): Landed on m-c.
Risk to taking this patch (and alternatives if risky): No, just changed the mistake of new API feature which is implemented on 32.
String or IDL/UUID changes made by this patch: No.
Attachment #8441229 - Flags: approval-mozilla-aurora?
Attachment #8441229 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.