Last Comment Bug 751881 - keyCode of keypress event for Tab key and ESC key is broken on Windows
: keyCode of keypress event for Tab key and ESC key is broken on Windows
: regression
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: Trunk
: x86 Windows 7
: -- normal (vote)
: mozilla15
Assigned To: Masayuki Nakano [:masayuki] (Mozilla Japan)
: Jim Mathies [:jimm]
: 751890 751891 752107 752109 752165 752717 (view as bug list)
Depends on:
Blocks: 166240 752048 752109
  Show dependency treegraph
Reported: 2012-05-04 07:01 PDT by Ekanan Ketunuti
Modified: 2012-05-07 16:50 PDT (History)
11 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (13.30 KB, patch)
2012-05-04 09:44 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
jmathies: review+
Details | Diff | Splinter Review

Description Ekanan Ketunuti 2012-05-04 07:01:01 PDT
1. use latest m-c or m-i
2. type `m` in urlbar. my first result for `m` is
3. press `tab` to select first result url autocomplete.

actual result 
- nothing happen, cannot use tab to select url autocomplete.

expected result 
- can use tab to select url autocomplete.

first bad revision is
changeset:   92974:de5745bce8bc
user:        Masayuki Nakano <>
date:        Thu May 03 17:35:02 2012 +0900
files:       content/events/test/test_dom_keyboard_event.html dom/base/nsDOMWindowUtils.cpp dom/interfaces/base/nsIDOMWindowUtils.idl layout/forms/test/test_bug348236.html testing/mochitest/tests/SimpleTest/EventUtils.js
Bug 166240 part.8 Add tests for KeyboardEvent.location (synthesized events) r=smaug, sr=jst

last good revision is 
changeset:   92966:a6a335cd2c94
user:        Jonathan Kew <>
date:        Thu May 03 08:57:30 2012 +0100
files:       layout/reftests/text-transform/greek-small-caps-1-ref.html layout/reftests/text-transform/greek-small-caps-1.html layout/reftests/text-transform/reftest.list
bug 307039 - reftest for Greek small-caps behavior. r=past

Comment 1 Marco Bonardo [::mak] 2012-05-04 07:20:39 PDT
Masayuki-san, could you please check/clarify how that fix affected the locationbar?
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 07:35:10 PDT
Hmm, I have no idea. In XP level, it shouldn't cause any regression.

The widget part for Windows is a little bit complex. I guess that the cause should be in part.2.
Comment 3 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 07:44:52 PDT
I'd like someone to test this regression on other platforms.
Comment 4 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 08:11:31 PDT
Ah, I see. I found a logical bug in the previous code. But the behavior is broken by the new code.
Comment 5 Ekanan Ketunuti 2012-05-04 08:23:25 PDT
Cannot reproduce on Linux. Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/15.0 Firefox/15.0a1
Comment 6 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 08:46:19 PDT
Thanks. I think that the keypress events of ESC key and Tab key do not work.
Comment 7 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 09:10:52 PDT
*** Bug 751891 has been marked as a duplicate of this bug. ***
Comment 8 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 09:11:33 PDT
*** Bug 751890 has been marked as a duplicate of this bug. ***
Comment 9 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 09:44:17 PDT
Created attachment 621077 [details] [diff] [review]

testing on tryserver.
Comment 10 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 10:01:27 PDT
Comment on attachment 621077 [details] [diff] [review]

At OnChar(), it sets keycode from wParam of WM_CHAR when charCode is zero. It's logically wrong, but it worked because native virtual keycode and native charcode are same for Tab key and Esc key.

This patch computes DOM keycode from scan code and sets it when keypress event's charCode is 0.
Comment 11 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 15:49:15 PDT
Comment 12 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 18:16:06 PDT
*** Bug 752109 has been marked as a duplicate of this bug. ***
Comment 13 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-05-04 18:19:18 PDT
*** Bug 752107 has been marked as a duplicate of this bug. ***
Comment 14 Mardeg 2012-05-04 23:21:47 PDT
*** Bug 752165 has been marked as a duplicate of this bug. ***
Comment 15 Dão Gottwald [:dao] 2012-05-07 16:50:42 PDT
*** Bug 752717 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.