Skip to content

Commit

Permalink
[e] (0) Lots of rewriting of the event handler attributes stuff: remo…
Browse files Browse the repository at this point in the history
…ve mention of namespaces, clarify some notes, clarify when the listeners are registered, clean up some class=impl usage.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=8630

git-svn-id: http://svn.whatwg.org/webapps@4521 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 6, 2010
1 parent aeb294c commit b2914a9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 54 deletions.
48 changes: 31 additions & 17 deletions complete.html
Expand Up @@ -51427,29 +51427,35 @@ <h5 id=event-handler-attributes><span class=secno>6.5.6.1 </span>Event handlers<

<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>.</p>

<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
Expand All @@ -51475,7 +51481,11 @@ <h5 id=event-handler-attributes><span class=secno>6.5.6.1 </span>Event handlers<
<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>

Expand All @@ -51490,7 +51500,11 @@ <h5 id=event-handler-attributes><span class=secno>6.5.6.1 </span>Event handlers<
<p class=note>In JavaScript, any <code title="">Function</code>
object implements this interface.</p>

</div>
<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.</p>


<div class=impl>
Expand Down
48 changes: 31 additions & 17 deletions index
Expand Up @@ -48592,29 +48592,35 @@ interface <dfn id=window>Window</dfn> {

<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>.</p>

<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
Expand All @@ -48640,7 +48646,11 @@ interface <dfn id=window>Window</dfn> {
<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>

Expand All @@ -48655,7 +48665,11 @@ interface <dfn id=function>Function</dfn> {
<p class=note>In JavaScript, any <code title="">Function</code>
object implements this interface.</p>

</div>
<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.</p>


<div class=impl>
Expand Down
54 changes: 34 additions & 20 deletions source
Expand Up @@ -57888,35 +57888,41 @@ interface <dfn>Window</dfn> {

<hr>

<p>All <span>event handlers</span> on an element, whether
set to null or to a <code>Function</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>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
<p>All <span>event handlers</span> on an object, whether an element
or some other object, and whether set to null or to a
<code>Function</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>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>Function</code> object, and set to invoke the <code
title="dom-function-call">call()</code> callback of the
<code>Function</code> object associated with the event handler otherwise.</p>
<code>Function</code> object associated with the event handler
otherwise.</p>

</div>

<p class="note"><span>Event handlers</span> <span
class="impl">therefore</span> always fire before event listeners
attached using <code
title="dom-EventTarget-addEventListener">addEventListener()</code>.</p>

<div class="impl">

<p class="note">The <var title="dom-event-listener">listener</var>
argument is emphatically <em>not</em> the <span title="event
handlers">event handler</span> itself.</p>

<p class="note">The interfaces implemented by the event object do
not affect whether an <span title="event handlers">event
handler</span> is used or not.</p>
not influence whether an <span title="event handlers">event
handler</span> is triggered or not.</p>

<p>When an <span title="event handlers">event handler</span>'s
<code>Function</code> object is invoked, its <code
Expand Down Expand Up @@ -57948,6 +57954,8 @@ interface <dfn>Window</dfn> {

</dl>

</div>

<!-- IE actually uncancels the event if the function returns true -->

<hr>
Expand All @@ -57967,7 +57975,13 @@ interface <dfn>Function</dfn> {
<p class="note">In JavaScript, any <code title="">Function</code>
object implements this interface.</p>

</div>
<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.</p>


<div class="impl">
Expand Down

0 comments on commit b2914a9

Please sign in to comment.