- From: poot <cvsmail@w3.org>
- Date: Wed, 6 Jan 2010 20:04:35 +0900 (JST)
- To: public-html-diffs@w3.org
hixie: Lots of rewriting of the event handler attributes stuff: remove mention of namespaces, clarify some notes, clarify when the listeners are registered, clean up some class=impl usage. (whatwg r4521) http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3617&r2=1.3618&f=h http://html5.org/tools/web-apps-tracker?from=4520&to=4521 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.3617 retrieving revision 1.3618 diff -u -d -r1.3617 -r1.3618 --- Overview.html 6 Jan 2010 10:52:14 -0000 1.3617 +++ Overview.html 6 Jan 2010 11:04:24 -0000 1.3618 @@ -43458,29 +43458,31 @@ <a href="#browsing-context">browsing context</a>, the corresponding event handler is not changed.</p><!-- v2: we should probably support HTML4's Content-Script-Type header here. --><div class="impl"> - <hr><p>All <a href="#event-handlers">event handlers</a> on an element, whether - set to null or to a <code><a href="#function">Function</a></code> object, must be registered - as event listeners on the element, as if the <code title="dom-EventTarget-addEventListenerNS">addEventListenerNS()</code> - method on the <code>Element</code> object's <code>EventTarget</code> - interface had been invoked when the event handler's - element or object was created, with the event type (<var title="dom-event-type">type</var> argument) equal to the type - corresponding to the event handler (the <dfn id="event-handler-event-type">event handler - event type</dfn>), the namespace (<var title="dom-event-namespaceURI">namespaceURI</var> argument) set to - null, the listener set to be a target and bubbling phase listener - (<var title="dom-event-useCapture">useCapture</var> argument set to - false), the event group set to the default group (<var title="dom-event-evtGroup">evtGroup</var> argument set to null), and - the event listener itself (<var title="dom-event-listener">listener</var> argument) set to do + <hr><p>All <a href="#event-handlers">event handlers</a> on an object, whether an element + or some other object, and whether set to null or to a + <code><a href="#function">Function</a></code> object, must be registered as event listeners + on the object when it is created, as if the <code title="dom-EventTarget-addEventListener">addEventListener()</code> + method on the object's <code>EventTarget</code> interface had been + invoked, with the event type (<var title="dom-event-type">type</var> + argument) equal to the type corresponding to the event handler (the + <dfn id="event-handler-event-type">event handler event type</dfn>), the listener set to be a + target and bubbling phase listener (<var title="dom-event-useCapture">useCapture</var> argument set to + false), and the event listener itself (<var title="dom-event-listener">listener</var> argument) set to do nothing while the event handler's value is not a <code><a href="#function">Function</a></code> object, and set to invoke the <code title="dom-function-call"><a href="#dom-function-call">call()</a></code> callback of the - <code><a href="#function">Function</a></code> object associated with the event handler otherwise.</p> + <code><a href="#function">Function</a></code> object associated with the event handler + otherwise.</p> + + </div><p class="note"><a href="#event-handlers">Event handlers</a> <span class="impl">therefore</span> always fire before event listeners + attached using <code title="dom-EventTarget-addEventListener">addEventListener()</code>.<div class="impl"> <p class="note">The <var title="dom-event-listener">listener</var> argument is emphatically <em>not</em> the <a href="#event-handlers" title="event handlers">event handler</a> itself.</p> <p class="note">The interfaces implemented by the event object do - not affect whether an <a href="#event-handlers" title="event handlers">event - handler</a> is used or not.</p> + not influence whether an <a href="#event-handlers" title="event handlers">event + handler</a> is triggered or not.</p> <p>When an <a href="#event-handlers" title="event handlers">event handler</a>'s <code><a href="#function">Function</a></code> object is invoked, its <code title="dom-function-call"><a href="#dom-function-call">call()</a></code> callback must be invoked @@ -43506,22 +43508,18 @@ <dd><p>If the return value is a boolean with the value false, then the event must be canceled.</dd> - </dl><!-- IE actually uncancels the event if the function returns true --><hr><p>The <code><a href="#function">Function</a></code> interface represents a function in the + </dl></div><!-- IE actually uncancels the event if the function returns true --><hr><p>The <code><a href="#function">Function</a></code> interface represents a function in the scripting language being used. It is represented in IDL as - follows:</p> - - <pre class="idl">[Callback=FunctionOnly, NoInterfaceObject] + follows:<pre class="idl">[Callback=FunctionOnly, NoInterfaceObject] interface <dfn id="function">Function</dfn> { any <a href="#dom-function-call" title="dom-function-call">call</a>(in any... arguments); -};</pre> - - <p>The <dfn id="dom-function-call" title="dom-function-call"><code>call(...)</code></dfn> - method is the object's callback.</p> - - <p class="note">In JavaScript, any <code title="">Function</code> - object implements this interface.</p> - - </div><div class="impl"> +};</pre><p>The <dfn id="dom-function-call" title="dom-function-call"><code>call(...)</code></dfn> + method is the object's callback.<p class="note">In JavaScript, any <code title="">Function</code> + object implements this interface.<p>The return value of the function is affects whether the event is + canceled or not: <span class="impl">as described above,</span> if + the return value is false, the event is canceled (except for <code class="event-mouseover">mouseover</code> events, where the return + value has to be true to cancel the event). With <code title="event-beforeunload">beforeunload</code> events, the value is + instead used to determine the message to show the user.<div class="impl"> <h5 id="event-handlers-on-elements-document-objects-and-window-objects"><span class="secno">6.5.6.2 </span>Event handlers on elements, <code>Document</code> objects, and <code><a href="#window">Window</a></code> objects</h5>
Received on Wednesday, 6 January 2010 11:05:03 UTC