This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23697 - KeyboardEventInit in UI Events doesn't include keyCode/charCode/which but in D3E, it includes them
Summary: KeyboardEventInit in UI Events doesn't include keyCode/charCode/which but in ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-01 07:23 UTC by Masayuki Nakano
Modified: 2014-04-08 00:31 UTC (History)
4 users (show)

See Also:


Attachments

Description Masayuki Nakano 2013-11-01 07:23:12 UTC
UI Event defines:

> dictionary KeyboardEventInit : UIEventInit {
>     DOMString     char = "";
>     DOMString     key = "";
>     DOMString     code = "";
>     unsigned long location = 0;
>     boolean       ctrlKey = false;
>     boolean       shiftKey = false;
>     boolean       altKey = false;
>     boolean       metaKey = false;
>     boolean       repeat = false;
>     DOMString     locale = "";
> };

D3E defines:

> dictionary KeyboardEventInit {
>     boolean       bubbles = false;
>     boolean       cancelable = false;
>     AbstractView? view = null;
>     long          detail = 0;
>     DOMString     key = "";
>     unsigned long location = 0;
>     boolean       ctrlKey = false;
>     boolean       shiftKey = false;
>     boolean       altKey = false;
>     boolean       metaKey = false;
>     boolean       repeat = false;
>     DOMString     locale = "";
>     unsigned long charCode = 0;
>     unsigned long keyCode = 0;
>     unsigned long which = 0;
> };

UI Events' definition doesn't include charCode/keyCode/which. However, all attributes which are legacy should be able to be initialized at constructing events.
# UI Events still have "char", so, I think that UI Events's definition is older than D3E's.
Comment 1 Masayuki Nakano 2013-11-01 07:27:19 UTC
NOTE:

If this is a bug of D3E, they should be dropped from next WD.
Comment 2 Masayuki Nakano 2013-11-01 08:46:24 UTC
Random thought:

If .keyCode/.charCode/.which are not initialized from KeyboardEvent constructor, web apps which handle the legacy attributes need to initialize them with initKey(board)Event which are different on each browser. So, ignoring them from initialization list might make creating automated tests for such web apps harder.

If they are not initialized from KeyboardEvent constructor, web apps also need to call initKey(board)Event() after that. It sounds the code is redundant.
Comment 3 Masayuki Nakano 2014-02-06 09:36:59 UTC
-> D3E since the constructor is moved to D3E from UI Events.
Comment 4 Gary Kacmarcik 2014-04-08 00:31:12 UTC
This information has been added to Appendix B - "Legacy Key Attributes" next to where charCode, keyCode and which are added to the KeyboardEvent.