New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 870337 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Input - Keypress KeyboardEvent returns empty string for every key

Reported by d.r.nat...@gmail.com, Aug 2

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce the problem:
1. Add an input to a page
2. Add an event listener to the input on "keypress" event
3. Observe that event received by listener has {code: ""}

What is the expected behavior?
KeyboardEvent for keypress event should have a readable code 

What went wrong?
The "code" attribute for keypress triggered KeyboardEvent objects is now always "" instead of an actual code.

Did this work before? Yes 67

Does this work in other browsers? Yes

Chrome version: 68.0.3440.75  Channel: n/a
OS Version: 10
Flash Version:
 
Windows-Chrome-67.png
610 KB View Download
Windows-Chrome-68.png
844 KB View Download
I'd like to clarify that even though I filled the form out in MacOS, this bug is for Windows versions of Chrome
Cc: garykac@chromium.org
Labels: Needs-Bisect
Status: Available (was: Unconfirmed)
I can reproduce this issue as well. CC'ing Gary as he might know what caused this. Can someone from QA bisects this?
Btw, here is a simple page logging the keyboard event code in the console.
https://output.jsbin.com/coneteq
Labels: Needs-Triage-M68
FYI: A better keyboard event viewer:
https://w3c.github.io/uievents/tools/key-event-viewer.html

Only the 'keypress' event is affected.

The 'keydown' and 'keyup' events have the |code| attribute set correctly.
Cc: camurcu@google.com
Labels: -Pri-2 -Needs-Bisect Pri-1
Owner: sadrul@chromium.org
Status: Assigned (was: Available)
I bisected this down to the following range:
https://chromium.googlesource.com/chromium/src/+log/37504ae03c72e0b931df8bb14b107383874244d4..6a178ca27a2c2cddab78a30b311307ee6e3927f2

And this is the most likely candidate:
https://chromium.googlesource.com/chromium/src/+/ebeb0698d0c29975f93c40b0b078c6764b1ad22a

+camurcu, can you take a look at this?  We'll probably want to cherry-pick this for M68.

(assigning to sadrul@ because camurcu@ is not a project member)
Yes, that is the cl that causes the bug. I've sent out a fix for review.
Labels: FoundIn-68
Any update on this?

Hopefully the fix you have will be small so that it can easily merged into M68.
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c475312192f217014fe9796cb4c04c84eb3d1b3a

commit c475312192f217014fe9796cb4c04c84eb3d1b3a
Author: Mustafa Çamurcu <camurcu@google.com>
Date: Fri Aug 10 14:50:33 2018

[Windows] Fix "DOM code is empty string" bug

UI::KeyEvent character event constructor defaulted to
have DomCode as NONE which resulted in an empty DOM code.
This cl makes DomCode an argument in the constructor and
populates the DomCode when known.

Bug: 870337
Change-Id: I8c87bb5ba451238dfe06f88d52c6f28912d61c46
Reviewed-on: https://chromium-review.googlesource.com/1162427
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Mustafa Çamurcu <camurcu@google.com>
Cr-Commit-Position: refs/heads/master@{#582159}
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ash/accelerators/accelerator_controller_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/components/arc/ime/arc_ime_service_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/components/exo/text_input_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/content/renderer/pepper/pepper_plugin_instance_impl.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/content/renderer/render_view_browsertest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/extensions/shell/browser/shell_desktop_controller_aura_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/services/ui/ime/ime_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/aura/window_tree_host_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/blink/web_input_event_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/event.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/event.h
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/event_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/mojo/event_struct_traits.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/mojo/struct_traits_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/events/win/events_win_utils.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/keyboard/keyboard_util.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/platform_window/android/BUILD.gn
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/platform_window/android/platform_window_android.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/views/controls/menu/menu_runner_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/views/controls/textfield/textfield_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/views/view_targeter_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/views/widget/root_view_unittest.cc
[modify] https://crrev.com/c475312192f217014fe9796cb4c04c84eb3d1b3a/ui/wm/core/compound_event_filter_unittest.cc

Seems to be resolved in Chrome Beta v70.0.3538.54 

Sign in to add a comment