one keydown might fire multiple keypress/textInput events

Spec text on keydown event
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-keydown

> if the key is associated with a character, the default action
> shall be to dispatch a textInput event with the character as
> the value of the TextEvent.data attribute

uses singular forms ('a textInput event') which doesn't take into account  
that a single keydown event might cause several keypress (-> textInput)  
events.

Trivial example: press a dead key twice. The default action of the second  
keydown will be to fire two keypress and two text input events.

More far-fetched: use a keyboard layout where some keys are mapped to  
input several characters. Chrome, Firefox and IE (on Windows) agree on  
firing keydown, multiple keypress (and multiple textInput if supported),  
single keyup.

Suggested text:

<li>if the key inserts one or more characters, the default action shall be  
to dispatch one <a class="eventtype"  
href="#event-type-textInput"><code>textInput</code></a> event for each  
character inserted, with that character as the value of the <a  
href="#events-TextEvent-data"><code>TextEvent.data</code></a> attribute

(Leaving aside for a moment the issue that I would also like to replace  
textInput with keypress in that text..)

-- 
Hallvord R. M. Steen, Core Tester, Opera Software
http://www.opera.com http://my.opera.com/hallvors/

Received on Wednesday, 22 September 2010 05:51:23 UTC