- From: Doug Schepers <schepers@w3.org>
- Date: Thu, 16 Sep 2010 09:56:14 -0400
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- CC: Simon Pieters <simonp@opera.com>, www-dom@w3.org
Hi, Folks- Boris Zbarsky wrote (on 9/16/10 3:43 AM): > On 9/16/10 12:19 AM, Simon Pieters wrote: >> Please specify keyCode and charCode, even if marked as 'obsolete'. > > Agreed. These do need to be specified, for web compat. > >> I'm pretty sure no browser is going to ship without at least one of >> them. (I >> notice that charCode is undefined in Opera, keyCode always returns 0 in >> Firefox, and in WebKit they both work.) > > keyCode works fine in Firefox with US keyboard layouts. Other keyboard > layouts may not work, though. After talking with many people, including browser vendors and the i18n WG, and doing a good bit of research, and considering the real-world use of keyCode and charCode, we came to the conclusion that it would be very difficult (if possible at all) to specify keyCode and charCode in a way that would be consistent across browsers, or even the same browser on different platforms. Browsers have had 15 years to get this right, and despite its importance, they haven't been able to. Not one browser we tested was consistent across platforms and keyboard layouts. Opera doesn't even really try. Every DOM Events specification (and I think some HTML specifications) tried to specify the behavior, and failed; in fact, keyboard events were the very reason this spec was parked as a WG Note for 5 years or so (note that this spec has already had the longest development time, by far, of any W3C spec... it was started over 10 years ago [1]). There is an enormous amount of content out there that relies on the current behavior, quirks and all, and I would be very concerned about breaking it by specifying keyCode and charCode in more detail than the spec already does. I suspect that browsers would not change their behavior to match the spec, or would revert when they got enough complaints for content authors; then whatever the spec says (beyond "these features are obsolete, use the replacements") would be misleading to content authors and implementers. By contrast, the new .key and .char properties stand a very good chance of being implemented interoperably between browsers across different platforms and keyboard layouts, and should be easier for content authors to use because they give more meaningful values, and account for keys that .keyCode and .charCode don't. I won't object to including more detailed keyCode and charCode definitions in the DOM3 Events spec, but I don't think I have the time or patience to do the work myself. To do so, only to make the features obsolete, seems wasteful, frustrating, possibly harmful, and probably misleading. However, if someone else wants to do that work, and if they manage to get it to the point where it is moderately consistent, and where browser vendors agree with the behavior and agree to implement it, and if they manage to specify it in a way that there are concrete testable assertions, and if they do so in a timely manner that doesn't slow down the effort to progress DOM3 Events along the Recommendation track so that the features it does have are more widely implemented and more quickly able to be used by content authors, then I will include that wording in the spec. Please do read what the spec says today about them first, as a possible starting point. As editor of the spec, I don't claim to be the sole author (thankfully!), so I welcome contributions... but looking at the history of key events over the last 15 years, I have grave concerns that tilting at these particular windmills will cause this spec to be fatally delayed, and I am skeptical that it would help anyone, other than providing a sense of closure on this open wound; stop picking at the scab, it will leave a scar. I think there are far more important things we could be doing that would have far greater positive impact for everyone involved. Shipping is a feature, whether you detect it with DOM3Events.hasFeature("Shipping") or DOM3Events.shipping. So, if there is a hearty soul out there who can harpoon this white whale before the end of the Last Call period, on 18 October, then I salute them. Otherwise, I would prefer to mark this issue as WONTFIX, so we don't have to wait another 10 years for it to be done. [1] http://www.w3.org/standards/history/DOM-Level-3-Events Regards- -Doug Schepers W3C Team Contact, SVG and WebApps WGs
Received on Thursday, 16 September 2010 13:56:17 UTC