ISSUE-169: added detail to keypress event description to clarify textinput as default action. Clarified similar text in the keydown event for implementations which do not support the keypress event.
--- a/html/DOM3-Events.html Mon Apr 04 15:24:22 2011 +0900
+++ b/html/DOM3-Events.html Mon Apr 04 15:44:00 2011 +0900
@@ -3988,7 +3988,7 @@
<ul>
<li>if the key is associated with a character, the default action must be to dispatch a <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event
<ul>
- <li>if the user agent does not support the keypress event, then the default action must be to dispatch a <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event</li>
+ <li>if the user agent does not support the keypress event, then the default action must be to dispatch a <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event with the <a href="#events-TextEvent-data"><code class="attribute-name">data</code></a> attribute set to the value of the <a href="#events-KeyboardEvent-char"><code class="attribute-name">char</code></a> attribute of the <a class="eventtype" href="#event-type-keypress"><code>keydown</code></a> event</li>
</ul>
</li>
<li>if the key is associated with a <a class="def" href="#glossary-text-composition-system">text composition system</a>, the default action must be to launch that system</li>
@@ -4037,6 +4037,7 @@
</tr>
</table>
<p>A <a class="def" href="#glossary-user-agent">user agent</a> must dispatch this event when a key is pressed down, if and only if that key normally produces a <a class="def" href="#glossary-character-value">character value</a>. The <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is device dependent and relies on the capabilities of the input devices and how they are mapped in the operating system. This event type must be generated after the <a class="def" href="#glossary-key-mapping">key mapping</a> but before the processing of an <a class="def" href="#glossary-ime">input method editor</a>, normally associated with the dispatching of a <a class="eventtype" href="#event-type-compositionstart"><code>compositionstart</code></a>, <a class="eventtype" href="#event-type-compositionupdate"><code>compositionupdate</code></a>, or <a class="eventtype" href="#event-type-compositionend"><code>compositionend</code></a> event. This event type must be dispatched after the <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event and before the <a class="eventtype" href="#event-type-keyup"><code>keyup</code></a> event associated with the same key.</p>
+ <p>The default action of the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event must be to dispatch a <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event with the <a href="#events-TextEvent-data"><code class="attribute-name">data</code></a> attribute set to the value of the <a href="#events-KeyboardEvent-char"><code class="attribute-name">char</code></a> attribute of the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event.</p>
<p class="note" id="_31"><strong>Note:</strong> the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event is traditionally associated with detecting a <a class="def" href="#glossary-character-value">character value</a> rather than a physical key, and may not be available on all keys in some configurations.</p>
<p class="warning" id="_32"><strong>Warning!</strong> the <a class="eventtype" href="#event-type-keypress"><code>keypress</code></a> event type is defined in this specification for reference and completeness, but this specification <a class="def" href="#glossary-deprecated">deprecates</a> the use of this event type in favor of the <a class="eventtype" href="#event-type-textinput"><code>textinput</code></a> event type.</p>
</dd>