Skip to content

Commit

Permalink
[] (0) Split the requirements on Function/EventListener from the requ…
Browse files Browse the repository at this point in the history
…irement regarding event handler attributes return false to cancel.

git-svn-id: http://svn.whatwg.org/webapps@844 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 24, 2007
1 parent c7b1809 commit 7448517
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 32 deletions.
38 changes: 23 additions & 15 deletions index
Expand Up @@ -1551,6 +1551,8 @@
3D scenes</a>

<li><a href="#timers"><span class=secno>11.4. </span>Timers</a>

<li><a href="#events2"><span class=secno>11.5. </span>Events</a>
</ul>

<li class=no-num><a href="#references">References</a>
Expand Down Expand Up @@ -26088,21 +26090,6 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
handler DOM attributes">event handler DOM attribute</a> (since they have
no content attributes).

<p id=js-function-listener>In the ECMAScript DOM binding, the ECMAScript
native <code>Function</code> type must implement the
<code>EventListener</code> interface such that invoking the
<code>handleEvent()</code> method of that interface on the object from
another language binding invokes the function itself, with the
<code>event</code> argument as its only argument. In the ECMAScript
binding itself, however, the <code>handleEvent()</code> method of the
interface is not directly accessible on <code>Function</code> objects.
Such functions, when invoked, must be called in the scope of the <a
href="#browsing0">browsing context</a> that they were created in. If the
function returns false, the event's <code>preventDefault()</code> method
must then invoked. Exception: for historical reasons, for the HTML
<code>mouseover</code> event, the <code>preventDefault()</code> method
must be called when the function returns true instead.

<p><dfn id=event2>Event handler content attributes</dfn>, when specified,
must contain valid ECMAScript code matching the ECMAScript <code
title="">FunctionBody</code> production. <a
Expand Down Expand Up @@ -26439,6 +26426,14 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
<!-- XXX need to fire this -->
</dl>

<p>When an event handler attribute is invoked, its argument must be set to
the <code>Event</code> object of the event in question. If the function
returns false, the event's <code>preventDefault()</code> method must then
invoked. Exception: for historical reasons, for the HTML
<code>mouseover</code> event, the <code>preventDefault()</code> method
must be called when the function returns true instead.</p>
<!-- IE actually uncancels the event if the function returns true -->

<p>When <a href="#scripting1">scripting is disabled</a>, event handler
attributes must do nothing.

Expand Down Expand Up @@ -38962,6 +38957,19 @@ interface <dfn id=timeouthandler>TimeoutHandler</dfn> {
<p>Timeouts must never fire while another script is executing. (Thus the
HTML scripting model is strictly single-threaded and not reentrant.)

<h3 id=events2><span class=secno>11.5. </span>Events</h3>

<p id=js-function-listener>In the ECMAScript DOM binding, the ECMAScript
native <code>Function</code> type must implement the
<code>EventListener</code> interface such that invoking the
<code>handleEvent()</code> method of that interface on the object from
another language binding invokes the function itself, with the
<code>event</code> argument as its only argument. In the ECMAScript
binding itself, however, the <code>handleEvent()</code> method of the
interface is not directly accessible on <code>Function</code> objects.
Such functions, when invoked, must be called in the scope of the <a
href="#browsing0">browsing context</a> that they were created in.

<h2 class=no-num id=references>References</h2>

<p class=big-issue>This section will be written in a future
Expand Down
43 changes: 26 additions & 17 deletions source
Expand Up @@ -23578,22 +23578,6 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
attributes">event handler DOM attribute</span> (since they have no
content attributes).</p>

<p id="js-function-listener">In the ECMAScript DOM binding, the
ECMAScript native <code>Function</code> type must implement the
<code>EventListener</code> interface such that invoking the
<code>handleEvent()</code> method of that interface on the object
from another language binding invokes the function itself, with the
<code>event</code> argument as its only argument. In the ECMAScript
binding itself, however, the <code>handleEvent()</code> method of
the interface is not directly accessible on <code>Function</code>
objects. Such functions, when invoked, must be called in the scope
of the <span>browsing context</span> that they were created in. If
the function returns false, the event's
<code>preventDefault()</code> method must then invoked. Exception:
for historical reasons, for the HTML <code>mouseover</code> event,
the <code>preventDefault()</code> method must be called when the
function returns true instead.</p>

<p><dfn>Event handler content attributes</dfn>, when specified, must
contain valid ECMAScript code matching the ECMAScript <code
title="">FunctionBody</code> production. <a
Expand Down Expand Up @@ -23861,9 +23845,19 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
title="event-unload">unload</code> event is targeted at or bubbles
through the element.</p></dd> <!-- XXX need to fire this -->


</dl>

<p>When an event handler attribute is invoked, its argument must be
set to the <code>Event</code> object of the event in question. If
the function returns false, the event's
<code>preventDefault()</code> method must then invoked. Exception:
for historical reasons, for the HTML <code>mouseover</code> event,
the <code>preventDefault()</code> method must be called when the
function returns true instead.</p>

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


<p>When <span>scripting is disabled</span>, event handler attributes
must do nothing.</p>

Expand Down Expand Up @@ -35593,6 +35587,21 @@ interface <dfn>TimeoutHandler</dfn> {
reentrant.)</p>


<h3>Events</h3>

<p id="js-function-listener">In the ECMAScript DOM binding, the
ECMAScript native <code>Function</code> type must implement the
<code>EventListener</code> interface such that invoking the
<code>handleEvent()</code> method of that interface on the object
from another language binding invokes the function itself, with the
<code>event</code> argument as its only argument. In the ECMAScript
binding itself, however, the <code>handleEvent()</code> method of
the interface is not directly accessible on <code>Function</code>
objects. Such functions, when invoked, must be called in the scope
of the <span>browsing context</span> that they were created in.</p>




<h2 class="no-num" id="references">References</h2>

Expand Down

0 comments on commit 7448517

Please sign in to comment.