--- a/html/DOM3-Events.html Wed May 04 16:35:21 2011 +0900
+++ b/html/DOM3-Events.html Thu May 05 01:55:26 2011 +0900
@@ -25,7 +25,7 @@
</p>
<h1 id="Overview-title">Document Object Model (DOM) Level 3 Events Specification</h1>
<!-- @@@ -->
- <h2 id="Overview-W3C-doctype">W3C Editor's Draft <time datetime="2011-05-03">3 May 2011</time></h2>
+ <h2 id="Overview-W3C-doctype">W3C Editor's Draft <time datetime="2011-05-04">4 May 2011</time></h2>
<dl>
<dt>This version:</dt>
<dd><a href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html?rev=1.154">http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html?rev=1.154</a></dd>
@@ -542,10 +542,10 @@
<dd>A <em>namespace URI</em> is a URI that identifies an XML namespace. This is called the namespace name in [<cite><a class="informative" href="#references-Namespaces10">XML Namespaces 1.0</a></cite>]. See also sections 1.3.2 "<a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#baseURIs-Considerations"><em>DOM URIs</em></a>" and 1.3.3 "<a class="normative" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations"><em>XML Namespaces</em></a>" regarding URIs and namespace URIs handling and comparison in the DOM APIs.</dd>
<dt id="glossary-phase"><dfn>phase</dfn></dt>
- <dd>In the context of <a class="def" href="#glossary-event">events</a>, a phase is set of logical traversals from node to node along the DOM tree, from the <a class="def" href="#glossary-defaultView">defaultView</a> (window), to the <code>Document</code> object, <a class="def" href="#glossary-root-element">root element</a> down to the <a class="def" href="#glossary-event-target">event target</a> (<a class="def" href="#glossary-capture-phase">capture phase</a>), at the <a class="def" href="#glossary-event-target">event target</a> itself (<a class="def" href="#glossary-target-phase">target phase</a>), and back up to the same chain (<a class="def" href="#glossary-bubbling-phase">bubbling phase</a>).</dd>
+ <dd>In the context of <a class="def" href="#glossary-event">events</a>, a phase is set of logical traversals from node to node along the DOM tree, from the <a class="def" href="#glossary-defaultView">defaultView</a> (window), to the <code>Document</code> object, <a class="def" href="#glossary-root-element">root element</a>, and down to the <a class="def" href="#glossary-event-target">event target</a> (<a class="def" href="#glossary-capture-phase">capture phase</a>), at the <a class="def" href="#glossary-event-target">event target</a> itself (<a class="def" href="#glossary-target-phase">target phase</a>), and back up the same chain (<a class="def" href="#glossary-bubbling-phase">bubbling phase</a>).</dd>
<dt id="glossary-propagation-path"><dfn>propagation path</dfn></dt>
- <dd>The ordered set of <a class="def" href="#glossary-event-target">event targets</a> though which an <a class="def" href="#glossary-event">event</a> object will pass sequentially on the way to and back from the <a class="def" href="#glossary-proximal-event-target">proximal event target</a>. As the event propagates, each <a class="def" href="#glossary-event-target">event target</a> in the propagation path must in turn be set as the <a href="#events-event-type-currentTarget"><code>Event.currentTarget</code></a>. The propagation path is initially comprised of one or more <a class="def" href="#glossary-event-phase">event phases</a> as defined by the <a class="def" href="#glossary-event-type">event type</a>, but may be interrupted. Also known as an <em>event target chain</em>.</dd>
+ <dd>The ordered set of <a class="def" href="#glossary-event-target">event targets</a> though which an <a class="def" href="#glossary-event">event</a> object will pass sequentially on the way to and back from the <a class="def" href="#glossary-proximal-event-target">proximal event target</a>. As the event propagates, each <a class="def" href="#glossary-event-target">event target</a> in the propagation path is in turn set as the <a href="#events-event-type-currentTarget"><code>Event.currentTarget</code></a>. The propagation path is initially composed of one or more <a class="def" href="#glossary-event-phase">event phases</a> as defined by the <a class="def" href="#glossary-event-type">event type</a>, but may be interrupted. Also known as an <em>event target chain</em>.</dd>
<dt id="glossary-proximal-event-target"><dfn>proximal event target</dfn></dt>
<dd>The proximal event target is the object representing the <a class="def" href="#glossary-event-target">event target</a> to which an <a class="def" href="#glossary-event">event</a> is targeted using the DOM event flow. The proximal event target is the value of the <a href="#events-event-type-target">Event.target</a> attribute.</dd>
@@ -560,7 +560,7 @@
<dd>An indication of incremental change on an input device using the <a href="#events-wheelevents">WheelEvent</a> interface. On some devices this may be a literal rotation of a wheel, while on others, it may be movement along a flat surface, or pressure on a particular button.</dd>
<dt id="glossary-text-composition-system"><dfn>text composition system</dfn></dt>
- <dd>A software component which interprets some form of alternate input, such as a <a class="def" href="#glossary-ime">input method editor</a>, a speech processor, or a handwriting recognition system, and converts it to text.</dd>
+ <dd>A software component that interprets some form of alternate input (such as a <a class="def" href="#glossary-ime">input method editor</a>, a speech processor, or a handwriting recognition system) and converts it to text.</dd>
<dt id="glossary-target-phase"><dfn>target phase</dfn></dt>
<dd>The process by which an <a class="def" href="#glossary-event">event</a> can be handled by the <a class="def" href="#glossary-proximal-event-target">proximal event target</a>. See the description of the <a href="#target-phase">target phase</a> in the context of event flow for more details.</dd>
@@ -578,7 +578,7 @@
<dd>A Unicode code point is a unique hexadecimal number signifying a character by its index in the Unicode codespace (or library of characters). In the context of key values, a Unicode code point is expressed as a string in the format “\u” followed by a hexadecimal character index in the range <code>0000</code> to <code>10FFFF</code>, using at least four digits. See also <a class="def charrep" href="#glossary-character-value">character value</a>.</dd>
<dt id="glossary-user-agent"><dfn>user agent</dfn></dt>
- <dd>A program, such as a browser or content authoring tool, normally running on a client machine, which acts on a user's behalf in retrieving, interpreting, executing, presenting, or creating content conforming to a specification. Users may act on the content using different user agents at different times, for different purposes. See the <a href="#conf-interactive-ua">Web browsers and other dynamic or interactive user agents</a> and <a href="#conf-author-tools">Authoring tools</a> conformance categories for more details.</dd>
+ <dd>A program, such as a browser or content authoring tool, normally running on a client machine, which acts on a user's behalf in retrieving, interpreting, executing, presenting, or creating content. Users may act on the content using different user agents at different times, for different purposes. See the <a href="#conf-interactive-ua">Web browsers and other dynamic or interactive user agents</a> and <a href="#conf-author-tools">Authoring tools</a> for details on the requirements for a <em>conforming</em> user agent.</dd>
</dl>
</div>
@@ -632,7 +632,7 @@
<p>
<span class="assert must">An implementation must trigger a listener by invoking the <a href="#events-EventListener-handleEvent"><code class="method-name">EventListener.handleEvent()</code></a> method or an equivalent binding-specific mechanism.</span>
</p>
- <p><span class="assert must">As the final step of the event dispatch, for reasons of backwards compatibility, the implementation must reset the event object's internal-propagation and default-action-prevention states.</span> This ensures that an event object may be properly dispatched multiple times while also allowing to prevent the event objects propagation or <a class="def" href="#glossary-default-action">default actions</a> prior to the event dispatch.</p>
+ <p><span class="assert must">As the final step of the event dispatch, for reasons of backwards compatibility, the implementation must reset the event object's internal-propagation and default-action-prevention states.</span> This ensures that an event object may be properly dispatched multiple times while also allowing to prevent the event object's propagation or <a class="def" href="#glossary-default-action">default actions</a> prior to the event dispatch.</p>
<p>In the production of the <a class="def" href="#glossary-propagation-path">propagation path</a>, if the <a class="def" href="#glossary-defaultView">defaultView</a> implements the <a href="#events-EventTarget">EventTarget</a> interface, the event propagates from <a class="def" href="#glossary-defaultView">defaultView</a> to the <code>document</code> object during the <a class="def" href="#glossary-capture-phase">capture phase</a>, and from the <code>document</code> object to the <a class="def" href="#glossary-defaultView">defaultView</a> during the <a class="def" href="#glossary-bubbling-phase">bubble phase</a>.</p>
<p>The model defined above must be applied regardless of the specific event flow associated with an event target. Each event flow must define how the propagation path must be determined and which event phases are supported. The <em>DOM event flow</em> is an application of this model: the propagation path for a <code>Node</code> object must be determined by its <code>Node.parentNode</code> chain, and if applicable, the document's containing <a class="def" href="#glossary-defaultView">defaultView</a>; all events accomplish the capture and target phases; whether an event accomplishes the bubble phase must be defined individually for each <a class="def" href="#glossary-event-type">event type</a>. An alternate application of this model can be found in [<cite><a class="informative" href="#references-DOMLS">DOM3 Load and Save</a></cite>].</p>
<p>Implementations of the DOM event model must be reentrant. Event listeners may perform actions that cause additional events to be dispatched. Such events are handled in a synchronous manner, the event propagation that causes the event listener to be triggered must resume only after the event dispatch of the new event is completed.</p>
@@ -647,19 +647,17 @@
.checked is changed just before 'click' event is dispatched, and if
default action is prevented, .checked is set to its original value.</span>
<p id="events-dt-cancelable-event">Some event objects are <em>cancelable</em>, meaning the <a class="def" href="#glossary-default-action">default action</a> can be prevented from occuring, or, if the <a class="def" href="#glossary-default-action">default action</a> is carried out before the dispatch, its effect may be reversed. Whether an event object is cancelable must be indicated by the <a href="#events-event-type-canCancel"><code>Event.cancelable</code></a> attribute. Event listeners can cancel <a class="def" href="#glossary-default-action">default actions</a> of cancelable event objects by invoking the <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a> method, and determine whether an event has been canceled through the <a href="#events-event-type-defaultPrevented"><code>Event.defaultPrevented</code></a> attribute while the object is being dispatched, or from the return value of the <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method for event objects dispatched by the <a class="def" href="#glossary-DOM-application">DOM application</a> itself.</p>
- <p>This specification does not offer features to programatically query if an event object has any <a class="def" href="#glossary-default-action">default action</a> associated with it, or to associate new <a class="def" href="#glossary-default-action">default actions</a> to an event object. Other specifications may define what default actions, if any, are associated with certain event objects. Further, implementations may associate <a class="def" href="#glossary-default-action">default actions</a> with events as necessary and appropriate for that implementation. As an example, one implementation may scroll a document view by a certain amount as <a class="def" href="#glossary-default-action">default action</a> of a mouse wheel event, while another implementation may instead zoom the document as its <a class="def" href="#glossary-default-action">default action</a> for a mouse wheel event.</p>
+ <p>This specification does not offer features to programatically query if an event object has any <a class="def" href="#glossary-default-action">default action</a> associated with it, or to associate new <a class="def" href="#glossary-default-action">default actions</a> with an event object. Other specifications may define what default actions, if any, are associated with certain event objects. Further, implementations may associate <a class="def" href="#glossary-default-action">default actions</a> with events as necessary and appropriate for that implementation. As an example, one implementation may scroll a document view by a certain amount as <a class="def" href="#glossary-default-action">default action</a> of a mouse wheel event, while another implementation may instead zoom the document as its <a class="def" href="#glossary-default-action">default action</a> for a mouse wheel event.</p>
</div>
<!-- div2 sync-async -->
<div>
<h3><a id="sync-async" href="#sync-async">3.3 Synchronous and asynchronous events</a></h3>
- <p>Events may occur either synchronously (<em>"sync"</em>) or asynchronously (<em>"async"</em>).</p>
- <p>Events which are synchronous must be treated as if they are in a virtual queue in a first-in-first-out model, ordered by sequence of temporal occurrence, with respect to other events, to changes in the DOM, and to user interaction. Each event in this virtual queue must be delayed until the previous event has completed its propagation behavior, or been canceled. Some sync events are driven by a specific device or process, such as mouse button events; these events are governed by the <a class="def" href="#glossary-event-order">event order</a> algorithms defined for that set of events, and a user agent must dispatch these events in the defined order.</p>
+ <p>Events may be either synchronously or asynchronously .</p>
+ <p>Events which are synchronous (<em>"sync events"</em>) must be treated as if they are in a virtual queue in a first-in-first-out model, ordered by sequence of temporal occurrence, with respect to other events, to changes in the DOM, and to user interaction. Each event in this virtual queue must be delayed until the previous event has completed its propagation behavior, or been canceled. Some sync events are driven by a specific device or process, such as mouse button events; these events are governed by the <a class="def" href="#glossary-event-order">event order</a> algorithms defined for that set of events, and a user agent must dispatch these events in the defined order.</p>
<p class="example" id="example-sync"><strong>Example:</strong> A user double-clicks a passage of text to select a word, then presses the <code class="value">'delete'</code> key to erase the word, triggering the following synchronous sequence of events: <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>, <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, <a class="eventtype" href="#event-type-click"><code>click</code></a>, <a class="eventtype" href="#event-type-mousedown"><code>mousedown</code></a>, <a class="eventtype" href="#event-type-mouseup"><code>mouseup</code></a>, <a class="eventtype" href="#event-type-click"><code>click</code></a>, <a class="eventtype" href="#event-type-dblclick"><code>dblclick</code></a>, <a class="eventtype" href="#event-type-select"><code>select</code></a>, <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a>, <a class="eventtype" href="#event-type-DOMCharacterDataModified"><code>DOMCharacterDataModified</code></a>. Each of these events are fired in the sequence initiated by the user's actions.</p>
- <p>Events which are asynchronous may be dispatched as the results of the action are completed, with no relation to other events, to other changes in the DOM, nor to user interaction.</p>
- <p class="example" id="example-async">
- <strong>Example:</strong>
- <i class="note" id="_5"><strong>To Do:</strong> Create good example of async events.</i>
+ <p>Events which are asynchronous (<em>"async events"</em>) may be dispatched as the results of the action are completed, with no relation to other events, to other changes in the DOM, nor to user interaction.</p>
+ <p class="example" id="example-async"><strong>Example:</strong> During loading of a document, an inline script element is parsed and executed. The <a class="eventtype" href="#event-type-load"><code>load</code></a> event is queued to be fired asynchronously at the script element. However, because it is an async event, its order with relation to other synchronous events fired during load (such as the DOMContentLoaded event from <cite><a class="informative" href="#references-HTML5">HTML5</a></cite>).
</p>
</div>
@@ -667,7 +665,7 @@
<div>
<h4><a id="event-order-and-loops" href="#event-order-and-loops">3.3.1 Event order and event loops</a></h4>
- <p>Most events take place in a sequential context. HTML5 [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines its event operations in terms of an event loop mechanism, in which events of all types are fed into different <em>task queues</em>. This specification does not define events in terms of this event loop mechanism, but it is compatible with this mechanism. Instead, this specification defines several operation-specific <a class="def" href="#glossary-event-order">event orders</a>.</p>
+ <p>Most events take place in a sequential context. [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>] defines its event operations in terms of an event loop mechanism, in which events of all types are fed into different <em>task queues</em>. This specification does not define events in terms of this event loop mechanism, but it is compatible with this mechanism. Instead, this specification defines several operation-specific <a class="def" href="#glossary-event-order">event orders</a>.</p>
<p>Using the terminology of HTML5, each independent device, such as a mouse or keyboard, should be treated as a <em>task source</em> which feeds into the appropriate <em>task queue</em>, in the order defined by the <a class="def" href="#glossary-event-order">event order</a> associated with that device; each operation, such as a focus change or composition input, also acts as a <em>task source</em> for the appropriate <em>task queue</em>. The resolution of these event loops is handled in a manner conforming to the <a class="def" href="#glossary-host-language">host language</a>, such as HTML [<cite><a class="informative" href="#references-HTML5">HTML5</a></cite>].</p>
<p class="warning" id="dropped-events"><strong>Warning!</strong> Certain events, such as “hotkeys” or controls keys pressed in a certain sequence, may be “swallowed” by the operating system or the application, interrupting the expected <a class="def" href="#glossary-event-order">event order</a>. Content authors should make appropriate checks for such occurrences.</p>
@@ -679,8 +677,8 @@
<div>
<h3><a id="trusted-events" href="#trusted-events">3.4 Trusted events</a></h3>
- <p>Events which are generated by the user agent, either as a result of user interaction, or as a direct result of changes to the DOM, are trusted by the user agent with privileges that are not afforded to events generated by script through the <a href="#events-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a> method, modified using the <a href="#events-event-type-initEvent"><code>Event.initEvent()</code></a> method, or dispatched via the <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. The <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute of trusted events has a value of <code>true</code>, while untrusted events have a <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>.</p>
- <p>Most untrusted events should not trigger <a class="def" href="#glossary-default-action">default actions</a>, with the exception of <a class="eventtype" href="#event-type-click"><code>click</code></a> or <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events which have been synthesized and are managed by the <a class="def" href="#glossary-user-agent">user agents</a> event as the <a class="def" href="#glossary-default-action">default action</a> of an <a class="def" href="#glossary-activation-trigger">activation trigger</a> (see <a href="#event-flow-activation">Activation triggers and behavior</a> for more details); these <a class="def" href="#glossary-user-agent">user-agent</a>-managed synthesized events have a have a <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>, but still initiate any <a class="def" href="#glossary-default-action">default actions</a>. All other untrusted events must behave as if the <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a> method had been called on that event.</p>
+ <p>Events that are generated by the user agent, either as a result of user interaction, or as a direct result of changes to the DOM, are trusted by the user agent with privileges that are not afforded to events generated by script through the <a href="#events-DocumentEvent-createEvent"><code>DocumentEvent.createEvent("Event")</code></a> method, modified using the <a href="#events-event-type-initEvent"><code>Event.initEvent()</code></a> method, or dispatched via the <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. The <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute of trusted events has a value of <code>true</code>, while untrusted events have a <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>.</p>
+ <p>Most untrusted events should not trigger <a class="def" href="#glossary-default-action">default actions</a>, with the exception of <a class="eventtype" href="#event-type-click"><code>click</code></a> or <a class="eventtype" href="#event-type-DOMActivate"><code>DOMActivate</code></a> events which have been synthesized and are managed by the <a class="def" href="#glossary-user-agent">user agents</a> event as the <a class="def" href="#glossary-default-action">default action</a> of an <a class="def" href="#glossary-activation-trigger">activation trigger</a> (see <a href="#event-flow-activation">Activation triggers and behaviors</a> for more details); these <a class="def" href="#glossary-user-agent">user-agent</a>-managed synthesized events have an <a href="#events-event-type-isTrusted"><code>isTrusted</code></a> attribute value of <code>false</code>, but still initiate any <a class="def" href="#glossary-default-action">default actions</a>. All other untrusted events must behave as if the <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a> method had been called on that event.</p>
<p>For security reasons, a <a class="def" href="#glossary-host-language">host language</a> should not define events which are not cancelable (see <a href="#event-flow-default-cancel">Default actions and cancelable events</a>), but also have <a class="def" href="#glossary-default-action">default actions</a>, since these <a class="def" href="#glossary-default-action">default actions</a> may be initiated by untrusted events.</p>
</div>
<!-- div2 Events-flow-cancelation -->
@@ -691,11 +689,11 @@
<p>A <a class="def" href="#glossary-host-language">host language</a> should indicate which, if any, elements have activation behavior, describe appropriate <a class="def" href="#glossary-activation-trigger">activation triggers</a>, and define the result of that activation behavior. An implementation which supports a <a class="def" href="#glossary-host-language">host language</a> should initiate these <a class="def" href="#glossary-activation-behavior">activation behavior</a> when the associated <a class="def" href="#glossary-activation-trigger">activation trigger</a> occurs.</p>
<p class="example" id="example-activation"><strong>Example:</strong> Both HTML and SVG have an <code class="element">a</code> element which indicates a link. Relevant <a class="def" href="#glossary-activation-trigger">activation triggers</a> for an <code class="element">a</code> element are a <a class="eventtype" href="#event-type-click"><code>click</code></a> event on the text or image content of the <code class="element">a</code> element, or a <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event with a <a href="#events-KeyboardEvent-key">key</a> attribute value of <a href="#key-Enter"><code class="value keyname">'Enter'</code></a> key when the <code class="element">a</code> element has focus. The activation behavior for an <code class="element">a</code> element is normally to change the content of the window to the content of the new document, in the case of external links, or to reposition the current document relative to the new anchor, in the case of internal links.</p>
<p>An <a class="def" href="#glossary-activation-trigger">activation trigger</a> is a user action or an event which indicates to the implementation that an activation behavior should be initiated. User-initiated <a class="def" href="#glossary-activation-trigger">activation triggers</a> include clicking a mouse button on an activatable element, pressing the <a href="#key-Enter"><code class="value keyname">'Enter'</code></a> key when an activatable element has focus, or pressing a key that is somehow linked to an activatable element (a “hotkey” or “access key”) even when that element does not have focus. Event-based <a class="def" href="#glossary-activation-trigger">activation triggers</a> may include timer-based events that activate an element at a certain clock time or after a certain time period has elapsed, progress events after a certain action has been completed, or many other condition-based or state-based events.</p>
- <p>In some cases, a <a class="def" href="#glossary-host-language">host language</a> may define attributes or even attribute values which add to or change the native <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a> of an element. For example, ARIA [<cite><a class="informative" href="#ref-ARIA">ARIA</a></cite>] defines values for the <code class="attr">role</code> attribute that add semantics to the element to which it is applied, for purposes of enhanced accessibility. In such cases, if the <a class="def" href="#glossary-host-language">host language</a> does not explicitly define the <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a>, the content author must provide the mechanics of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> (via an event listener) or <a class="def" href="#glossary-activation-behavior">activation behavior</a> (such as calling an ECMAScript function) for that element when applying that attributes or attribute value.</p>
+ <p>In some cases, a <a class="def" href="#glossary-host-language">host language</a> may define attributes or even attribute values which add to or change the native <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a> of an element. For example, ARIA [<cite><a class="informative" href="#ref-ARIA">ARIA</a></cite>] defines values for the <code class="attr">role</code> attribute that add semantics to the element to which it is applied, for purposes of enhanced accessibility. In such cases, if the <a class="def" href="#glossary-host-language">host language</a> does not explicitly define the <a class="def" href="#glossary-activation-trigger">activation trigger</a> or <a class="def" href="#glossary-activation-behavior">activation behavior</a>, the content author must provide the mechanics of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> (via an event listener) or <a class="def" href="#glossary-activation-behavior">activation behavior</a> (such as calling an ECMAScript function) for that element when applying that attribute or attribute value.</p>
<h4><a id="click-synthesis" href="#click-synthesis">3.5.1 Activation event synthesis</a></h4>
- <p>If the instance of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> is not an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> (that is, when it does not result from a user activating a button or link using a mouse or equivalent pointing device), the implementation must synthesize and dispatch an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> as one of the <a class="def" href="#glossary-default-action">default actions</a> of that <a class="def" href="#glossary-activation-trigger">activation trigger</a>; the value of the <code class="attribute-name"><a href="#events-event-type-target">Event.target</a></code> must be set to the <a class="def" href="#glossary-proximal-event-target">proximal event target</a> (normally, the currently focused element), and the event must simulate a <em>left click</em> (i.e., the <a href="#events-MouseEvent-button"><code>MouseEvent.button</code></a> attribute value must be <code>0</code>, and the <a href="#events-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attribute value must be <code>1</code>). Other context information of such a simulated <a class="eventtype" href="#event-type-click"><code>click</code></a> event is implementation dependent, but for historical purposes, the interface for the <a class="eventtype" href="#event-type-click"><code>click</code></a> event must be the <a href="#events-MouseEvent"><code>MouseEvent interface</code></a>, regardless of the actual device used to activate the element. Preventing the <a class="def" href="#glossary-default-action">default action</a> of the <a class="def" href="#glossary-activation-trigger">activation trigger</a>, such as with the <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a>, must stop the initiation of the <a class="def" href="#glossary-activation-behavior">activation behavior</a>.</p>
+ <p>If the instance of the <a class="def" href="#glossary-activation-trigger">activation trigger</a> is not an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> (that is, when it does not result from a user's activation of a button or link using a mouse or equivalent pointing device), the implementation must synthesize and dispatch an event of <a class="def" href="#glossary-event-type">event type</a> <a class="eventtype" href="#event-type-click"><code>click</code></a> as one of the <a class="def" href="#glossary-default-action">default actions</a> of that <a class="def" href="#glossary-activation-trigger">activation trigger</a>; the value of the <code class="attribute-name"><a href="#events-event-type-target">Event.target</a></code> must be set to the <a class="def" href="#glossary-proximal-event-target">proximal event target</a> (normally, the currently focused element), and the event must simulate a <em>left click</em> (i.e., the <a href="#events-MouseEvent-button"><code>MouseEvent.button</code></a> attribute value must be <code>0</code>, and the <a href="#events-MouseEvent-buttons"><code>MouseEvent.buttons</code></a> attribute value must be <code>1</code>). Other context information of such a simulated <a class="eventtype" href="#event-type-click"><code>click</code></a> event is implementation dependent, but for historical purposes, the interface for the <a class="eventtype" href="#event-type-click"><code>click</code></a> event must be the <a href="#events-MouseEvent"><code>MouseEvent interface</code></a>, regardless of the actual device used to activate the element. Preventing the <a class="def" href="#glossary-default-action">default action</a> of the <a class="def" href="#glossary-activation-trigger">activation trigger</a>, such as with the <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a>, must stop the initiation of the <a class="def" href="#glossary-activation-behavior">activation behavior</a>.</p>
<p class="example" id="example-activation-click"><strong>Example:</strong> When a user activates a hyperlink using a keyboard, such as by focusing the hyperlink element and pressing the <a href="#key-Enter"><code class="value keyname">'Enter'</code></a> or <a href="#key-Spacebar"><code class="value keyname">'Space'</code></a> key, a <a class="eventtype" href="#event-type-click"><code>click</code></a> event would be dispatched as the <a class="def" href="#glossary-default-action">default action</a> of the respective <a class="eventtype" href="#event-type-keydown"><code>keydown</code></a> event.</p>
<p>Implementations must dispatch the synthesized <a class="eventtype" href="#event-type-click"><code>click</code></a> event as described above even if they do not normally dispatch such an event (e.g., when activation is requested by a voice command, since this specification does not address <a class="def" href="#glossary-event-type">event types</a> for voice input).</p>
<p class="note" id="application-dependent-activation"><strong>Note:</strong> The activation of an event target is device dependent, but is also application dependent, e.g., a link in a document can be activated using a mouse click or a mouse double click.</p>
@@ -3716,12 +3714,12 @@
<dd><p><code>true</code> if the <a href="#key-Ctrl"><code class="value keyname">'Ctrl'</code></a> (control) key modifier was active.</p></dd>
<dt><code class="attribute-name"><a id="events-KeyboardEvent-char">char</a></code> of type <code>DOMString</code>, readonly</dt>
- <dd><p><code>char</code> holds the character value of the key pressed. The value must be a Unicode character string, conforming to the <a href="#key-algorithm">algorithm for determining the key value</a> defined in this specification. For a key associated with a macro to insert multiple characters, the value of the <code>char</code> attribute will hold the entire sequence of characters. For a key which does not have a character representation, the value must be the <a class="def" href="#glossary-empty-string">empty string</a>.</p>
+ <dd><p><code>char</code> holds the character value of the key pressed. If the key press has a printed representation, then the value must be a non-empty Unicode character string, conforming to the <a href="#key-algorithm">algorithm for determining the key value</a> defined in this specification. For a key associated with a macro to insert multiple characters, the value of the <code>char</code> attribute will hold the entire sequence of characters. For a key which does not have a character representation, the value must be the <a class="def" href="#glossary-empty-string">empty string</a>.</p>
<p class="note" id="note-char-charCode"><strong>Note:</strong> the <code>char</code> attribute is not related to the legacy <code>charCode</code> attribute and does not have the same set of values.</p>
</dd>
<dt><code class="attribute-name"><a id="events-KeyboardEvent-key">key</a></code> of type <code>DOMString</code>, readonly</dt>
- <dd><p><code>key</code> holds the key value of the key pressed. If the value is a character, it must match the value of the <a href="#events-KeyboardEvent-char"><code>KeyboardEvent.char</code></a> attribute; if the value is a control key which has no printed representation, it must be one of the key values defined in the <a href="#keys-keyvalues">key values set</a>, as determined by the <a href="#key-algorithm">algorithm for determining the key value</a>. Implementations that are unable to identify a key must use the key value <code class="value">'Unidentified'</code>.</p>
+ <dd><p><code>key</code> holds the key value of the key pressed. If the value is has a printed representation, it must match the value of the <a href="#events-KeyboardEvent-char"><code>KeyboardEvent.char</code></a> attribute; if the value is a control key which has no printed representation, it must be one of the key values defined in the <a href="#keys-keyvalues">key values set</a>, as determined by the <a href="#key-algorithm">algorithm for determining the key value</a>. Implementations that are unable to identify a key must use the key value <code class="value">'Unidentified'</code>.</p>
<p class="note" id="note-key-keyCode"><strong>Note:</strong> the <code>key</code> attribute is not related to the legacy <code>charCode</code> attribute and does not have the same set of values.</p>
<!-- <p class="note" id="note-key-keyCode"><strong>Note:</strong> the <code>key</code> attribute is not related to the legacy <a href="#events-KeyboardEvent-keyCode"><code>KeyboardEvent.keyCode</code></a> attribute and does not have the same set of values.</p> -->
</dd>