Fixing: https://www.w3.org/Bugs/Public/show_bug.cgi?id=16332
authortleithea
Fri, 20 Apr 2012 09:29:42 +0900
changeset 364 44914f8557f8
parent 363 11155882692e
child 365 90c2ebb2db80
Fixing: https://www.w3.org/Bugs/Public/show_bug.cgi?id=16332
(stop propagation and preventDefault states during multiple dispatches)
html/DOM3-Events.html
--- a/html/DOM3-Events.html	Fri Apr 20 09:26:54 2012 +0900
+++ b/html/DOM3-Events.html	Fri Apr 20 09:29:42 2012 +0900
@@ -672,7 +672,6 @@
         <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 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>
@@ -999,7 +998,9 @@
                   </dt>
                   <dd>
                     <div class="method">
-                      <p>Initializes attributes of an <code>Event</code> created through the <a href="#events-DocumentEvent-createEvent"><code>DocumentEvent.createEvent</code></a> method. This method must be called before the <code>Event</code> has been dispatched via the <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. If the method is called several times before invoking <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, only the final invocation takes precedence. This method has no effect if called after the event has been dispatched. If called from a subclass of the <code>Event</code> interface only the values specified in this method are modified, all other attributes are left unchanged.</p>
+                      <p>Initializes attributes of an <code>Event</code> created through the <a href="#events-DocumentEvent-createEvent"><code>DocumentEvent.createEvent</code></a> method. This method must be called before the <code>Event</code> has been dispatched via the <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent()</code></a> method. If the method is called several times before invoking <a href="#events-EventTarget-dispatchEvent"><code>EventTarget.dispatchEvent</code></a>, only the final invocation takes precedence. If called from a subclass of the <code>Event</code> interface only the values specified in this method are modified, all other attributes are left unchanged.</p>
+                      <p><span>This method must also reset the event object's internal-propagation and default-action-prevention states.</span> This allows an event object to be "reset" before being dispatched multiple times.</p>
+                      <p class="example"><strong>Example: </strong>If an <code>EventListener</code> called <code>stopPropagation()</code> or <code>stopImmediatePropagation()</code> during the event's previous dispatch, then after calling this method, the event can be re-dispatched (via <code>dispatchEvent</code>) and will propagate through all candidate event listeners along its propagation path (as it did during the prior dispatch). Similarily, if an <code>EventListener</code> called <code>preventDefault()</code> during the event's previous dispatch, then after calling this method, the event's <code>defaultPrevented</code> property will be <code>false</code>.</p>
                       <p class="warning" id="warning-initEvent-untrusted"><strong>Warning!</strong>  For security reasons, events modified using <a href="#events-event-type-initEvent"><code>Event.initEvent()</code></a> must have a <code class="attribute-name"><a href="#events-event-type-isTrusted">isTrusted</a></code> attribute value of <code>false</code>.  See <a href="#trusted-events">trusted events</a> for more details.</p>
 
                       <div class="parameters">
@@ -1246,7 +1247,16 @@
                         </div>
                       </div>
                       <!-- parameters -->
-                      <div class="return"><strong>Return Value</strong><div class="returntable"><table summary="Layout table: the first cell contains the type of the return value, the second contains a short description" border="0"><tr><td><p><code>boolean</code></p></td><td><p>Indicates whether any of the listeners which handled the event called <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a>. If <a href="#events-event-type-preventDefault"><code>Event.preventDefault()</code></a> was called the returned value must be <code>false</code>, else it must be <code>true</code>.</p></td></tr></table></div></div>
+                      <div class="return"><strong>Return Value</strong>
+                        <div class="returntable">
+                          <table summary="Layout table: the first cell contains the type of the return value, the second contains a short description" border="0">
+                           <tr>
+                            <td><p><code>boolean</code></p></td>
+                            <td><p>Indicates whether some default action can be applied based on the result of propagating the event object. If after the event object finishes propagating through the DOM event flow its <a href="#events-event-type-defaultPrevented"><code>Event.defaultPrevented</code></a> attribute is <code>false</code>, then this method returns <code>true</code>. Otherwise this method returns <code>false</code>.</p></td>
+                           </tr>
+                          </table>
+                        </div>
+                      </div>
                       <!-- return -->
                       <div class="exceptions">
                         <strong>Exceptions</strong>