Intent to Ship: DOM KeyboardEvent.key attribute

106 views
Skip to first unread message

Chong

unread,
Mar 29, 2016, 4:33:39 PM3/29/16
to blink-dev

Contact emails

cho...@chromium.org, dtap...@chromium.org


Spec

https://w3c.github.io/uievents/#keys-keyvalues

https://w3c.github.io/uievents-key/


Summary

KeyboardEvent.key contains a standardized name of the value produced by a key. The value presented could be an appropriate character in the key values set, or the char value if the key generates a printable character.


Motivation

KeyboardEvent.key is useful when content authors need to retrieve the character value of character-producing keys and the key value of control keys, modifier keys, or other keys that do not generate characters, with respect to possible custom key-mapping.


These values can be used for monitoring input strings and modifier keys, and can be used for creating virtual keyboards or other purposes.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/Dom$20code$20Intent$20to$20implement/blink-dev/Qz9OekVPHVE/74TE5BAQH40J


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Interoperability and Compatibility Risk

Low. We have positive support from Microsoft and Mozilla, and we don't expect any compatibility problems.


OWP launch tracking bug

https://crbug.com/227231


Entry on the feature dashboard

https://www.chromestatus.com/feature/4748790720364544

Chris Harrelson

unread,
Mar 29, 2016, 6:32:06 PM3/29/16
to Chong, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dimitri Glazkov

unread,
Mar 29, 2016, 6:32:24 PM3/29/16
to Chris Harrelson, Chong, blink-dev
LGTM2

TAMURA, Kent

unread,
Mar 29, 2016, 9:28:30 PM3/29/16
to Dimitri Glazkov, Chong, Chris Harrelson, blink-dev

lgtm3

2016/03/30 午前7:32 "Dimitri Glazkov" <dgla...@chromium.org>:

PhistucK

unread,
Mar 30, 2016, 2:42:36 AM3/30/16
to Chong, blink-dev

On Tue, Mar 29, 2016 at 11:33 PM, Chong <cho...@chromium.org> wrote:
Low. We have positive support from Microsoft and Mozilla, and we don't expect any compatibility problems.

Hm, it seems to already be implemented in Firefox​ and Internet Explorer (I have not tried Edge). This should be mentioned instead of "positive support", since it is a stronger sign.
Can you confirm that the implementation is interoperable?



PhistucK

Chong

unread,
Mar 30, 2016, 10:32:50 AM3/30/16
to blink-dev, cho...@chromium.org
Sorry for the confusion. Yes it's supported since Firefox 29.0 and Internet Explorer 9.0 (as well as Edge), and the implementation is interoperable.

Also see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

Gary Kačmarčík (Кошмарчик)

unread,
Mar 30, 2016, 12:38:48 PM3/30/16
to Chong, blink-dev
I think that it's more accurate to say that we are interoperable with FF and that the IE version is mostly-interoperable.

The history is something like:

   IE implementation -> Spec -> Updated Spec -> FF implementation -> Chrome implementation

Microsoft has indicated that they will be updating their implementation in Edge to be fully interoperable, but I don't know the timeline for that.

As of now, the Edge version appears to be a cut/paste of the IE version.  Note that IE/Edge are also missing the 'code' attribute, which is closely related to 'key'.


--

PhistucK

unread,
Mar 31, 2016, 6:42:35 AM3/31/16
to Gary Kačmarčík (Кошмарчик), Chong, blink-dev
I suspected so, but I took his word for it. ;)

Is there a comprehensive test suite, by the way?


PhistucK

Chong

unread,
Mar 31, 2016, 10:23:55 AM3/31/16
to blink-dev, gar...@google.com, cho...@chromium.org
There is a manual test suite for en-US and fr-FR:
https://github.com/w3c/uievents#testing

And since this cannot be tested by layout tests I have some unit tests:

Windows: US layout and FR layout, dead keys, modifier combinations
(platform_key_map_win_unittest.cc)

Mac: US layout, dead keys, modifier combinations
(web_input_event_builders_mac_unittest.mm)

Android: Default layout, dead keys, modifier combinations
(web_input_event_builders_android_unittest.cc)

ChromeOS: Dead keys
(input_method_chromeos_unittest.cc)


On Thursday, March 31, 2016 at 6:42:35 AM UTC-4, PhistucK wrote:
I suspected so, but I took his word for it. ;)

Is there a comprehensive test suite, by the way?


PhistucK

On Wed, Mar 30, 2016 at 7:38 PM, 'Gary Kačmarčík (Кошмарчик)' via blink-dev <blin...@chromium.org> wrote:
I think that it's more accurate to say that we are interoperable with FF and that the IE version is mostly-interoperable.

The history is something like:

   IE implementation -> Spec -> Updated Spec -> FF implementation -> Chrome implementation

Microsoft has indicated that they will be updating their implementation in Edge to be fully interoperable, but I don't know the timeline for that.

As of now, the Edge version appears to be a cut/paste of the IE version.  Note that IE/Edge are also missing the 'code' attribute, which is closely related to 'key'.
On Wed, Mar 30, 2016 at 7:32 AM, Chong <cho...@chromium.org> wrote:
Sorry for the confusion. Yes it's supported since Firefox 29.0 and Internet Explorer 9.0 (as well as Edge), and the implementation is interoperable.

Also see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

On Wednesday, March 30, 2016 at 2:42:36 AM UTC-4, PhistucK wrote:

On Tue, Mar 29, 2016 at 11:33 PM, Chong <cho...@chromium.org> wrote:
Low. We have positive support from Microsoft and Mozilla, and we don't expect any compatibility problems.

Hm, it seems to already be implemented in Firefox​ and Internet Explorer (I have not tried Edge). This should be mentioned instead of "positive support", since it is a stronger sign.
Can you confirm that the implementation is interoperable?



PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Wez

unread,
Mar 31, 2016, 12:26:04 PM3/31/16
to Chong, blink-dev, Gary Kačmarčík
Do we have any testing for the fields on JS-synthesized events, especially those synthesized w/ only legacy fields provided by the caller?



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.


Chong

unread,
Mar 31, 2016, 2:59:41 PM3/31/16
to blink-dev, cho...@chromium.org, gar...@google.com
Yes we have constructor tests for KeyboardEvent.key, but we won't normalize it even if it does not match other fields.


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.


Reply all
Reply to author
Forward
0 new messages