[html5] r2684 - [] (0) Bring the event handler attribute stuff in line with reality. Make onerro [...]

whatwg at whatwg.org whatwg at whatwg.org
Wed Jan 21 01:09:22 PST 2009


Author: ianh
Date: 2009-01-21 01:09:21 -0800 (Wed, 21 Jan 2009)
New Revision: 2684

Modified:
   index
   source
Log:
[] (0) Bring the event handler attribute stuff in line with reality. Make onerror='' and .onerror make sense and compatible with legacy content.

Modified: index
===================================================================
--- index	2009-01-21 00:58:10 UTC (rev 2683)
+++ index	2009-01-21 09:09:21 UTC (rev 2684)
@@ -672,9 +672,10 @@
      <li><a href=#events><span class=secno>5.4.6 </span>Events</a>
       <ol>
        <li><a href=#event-handler-attributes><span class=secno>5.4.6.1 </span>Event handler attributes</a></li>
-       <li><a href=#event-firing><span class=secno>5.4.6.2 </span>Event firing</a></li>
-       <li><a href=#events-and-the-window-object><span class=secno>5.4.6.3 </span>Events and the <code>Window</code> object</a></li>
-       <li><a href=#runtime-script-errors><span class=secno>5.4.6.4 </span>Runtime script errors</a></ol></ol></li>
+       <li><a href=#event-handler-attributes-on-elements-and-on-window-objects><span class=secno>5.4.6.2 </span>Event handler attributes on elements and on <code>Window</code> objects</a></li>
+       <li><a href=#event-firing><span class=secno>5.4.6.3 </span>Event firing</a></li>
+       <li><a href=#events-and-the-window-object><span class=secno>5.4.6.4 </span>Events and the <code>Window</code> object</a></li>
+       <li><a href=#runtime-script-errors><span class=secno>5.4.6.5 </span>Runtime script errors</a></ol></ol></li>
    <li><a href=#user-prompts><span class=secno>5.5 </span>User prompts</a>
     <ol>
      <li><a href=#simple-dialogs><span class=secno>5.5.1 </span>Simple dialogs</a></li>
@@ -6623,40 +6624,40 @@
   readonly attribute <span>CSSStyleDeclaration</span> <a href=#dom-style title=dom-style>style</a>;
 
   // <a href=#event-handler-dom-attributes>event handler DOM attributes</a>
-           attribute <span>EventListener</span> <a href=#handler-onabort title=handler-onabort>onabort</a>;
-           attribute <span>EventListener</span> <a href=#handler-onbeforeunload title=handler-onbeforeunload>onbeforeunload</a>;
-           attribute <span>EventListener</span> <a href=#handler-onblur title=handler-onblur>onblur</a>;
-           attribute <span>EventListener</span> <a href=#handler-onchange title=handler-onchange>onchange</a>;
-           attribute <span>EventListener</span> <a href=#handler-onclick title=handler-onclick>onclick</a>;
-           attribute <span>EventListener</span> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragenter title=handler-ondragenter>ondragenter</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragleave title=handler-ondragleave>ondragleave</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragover title=handler-ondragover>ondragover</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragstart title=handler-ondragstart>ondragstart</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondrop title=handler-ondrop>ondrop</a>;
-           attribute <span>EventListener</span> <a href=#handler-onerror title=handler-onerror>onerror</a>;
-           attribute <span>EventListener</span> <a href=#handler-onfocus title=handler-onfocus>onfocus</a>;
-           attribute <span>EventListener</span> <a href=#handler-onhashchange title=handler-onhashchange>onhashchange</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeydown title=handler-onkeydown>onkeydown</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeypress title=handler-onkeypress>onkeypress</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeyup title=handler-onkeyup>onkeyup</a>;
-           attribute <span>EventListener</span> <a href=#handler-onload title=handler-onload>onload</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmessage title=handler-onmessage>onmessage</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousedown title=handler-onmousedown>onmousedown</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousemove title=handler-onmousemove>onmousemove</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseout title=handler-onmouseout>onmouseout</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseover title=handler-onmouseover>onmouseover</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseup title=handler-onmouseup>onmouseup</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousewheel title=handler-onmousewheel>onmousewheel</a>;
-           attribute <span>EventListener</span> <a href=#handler-onresize title=handler-onresize>onresize</a>;
-           attribute <span>EventListener</span> <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
-           attribute <span>EventListener</span> <a href=#handler-onselect title=handler-onselect>onselect</a>;
-           attribute <span>EventListener</span> <a href=#handler-onstorage title=handler-onstorage>onstorage</a>;
-           attribute <span>EventListener</span> <a href=#handler-onsubmit title=handler-onsubmit>onsubmit</a>;
-           attribute <span>EventListener</span> <a href=#handler-onunload title=handler-onunload>onunload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onabort title=handler-onabort>onabort</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onbeforeunload title=handler-onbeforeunload>onbeforeunload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onblur title=handler-onblur>onblur</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragenter title=handler-ondragenter>ondragenter</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragleave title=handler-ondragleave>ondragleave</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragover title=handler-ondragover>ondragover</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragstart title=handler-ondragstart>ondragstart</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondrop title=handler-ondrop>ondrop</a>;
+           attribute any <a href=#handler-onerror title=handler-onerror>onerror</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onfocus title=handler-onfocus>onfocus</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onhashchange title=handler-onhashchange>onhashchange</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeydown title=handler-onkeydown>onkeydown</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeypress title=handler-onkeypress>onkeypress</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeyup title=handler-onkeyup>onkeyup</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onload title=handler-onload>onload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmessage title=handler-onmessage>onmessage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousedown title=handler-onmousedown>onmousedown</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousemove title=handler-onmousemove>onmousemove</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseout title=handler-onmouseout>onmouseout</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseover title=handler-onmouseover>onmouseover</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseup title=handler-onmouseup>onmouseup</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousewheel title=handler-onmousewheel>onmousewheel</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onresize title=handler-onresize>onresize</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onselect title=handler-onselect>onselect</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onstorage title=handler-onstorage>onstorage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onsubmit title=handler-onsubmit>onsubmit</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onunload title=handler-onunload>onunload</a>;
 
 };</pre>
 
@@ -33627,40 +33628,40 @@
   void <a href=#dom-window-postmessage-3 title=dom-window-postMessage-3>postMessage</a>(in any message, in <a href=#messageport>MessagePort</a> messagePort, in DOMString targetOrigin);
 
   // <a href=#event-handler-dom-attributes>event handler DOM attributes</a>
-           attribute <span>EventListener</span> <a href=#handler-onabort title=handler-onabort>onabort</a>;
-           attribute <span>EventListener</span> <a href=#handler-onbeforeunload title=handler-onbeforeunload>onbeforeunload</a>;
-           attribute <span>EventListener</span> <a href=#handler-onblur title=handler-onblur>onblur</a>;
-           attribute <span>EventListener</span> <a href=#handler-onchange title=handler-onchange>onchange</a>;
-           attribute <span>EventListener</span> <a href=#handler-onclick title=handler-onclick>onclick</a>;
-           attribute <span>EventListener</span> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragenter title=handler-ondragenter>ondragenter</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragleave title=handler-ondragleave>ondragleave</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragover title=handler-ondragover>ondragover</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondragstart title=handler-ondragstart>ondragstart</a>;
-           attribute <span>EventListener</span> <a href=#handler-ondrop title=handler-ondrop>ondrop</a>;
-           attribute <span>EventListener</span> <a href=#handler-onerror title=handler-onerror>onerror</a>;
-           attribute <span>EventListener</span> <a href=#handler-onfocus title=handler-onfocus>onfocus</a>;
-           attribute <span>EventListener</span> <a href=#handler-onhashchange title=handler-onhashchange>onhashchange</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeydown title=handler-onkeydown>onkeydown</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeypress title=handler-onkeypress>onkeypress</a>;
-           attribute <span>EventListener</span> <a href=#handler-onkeyup title=handler-onkeyup>onkeyup</a>;
-           attribute <span>EventListener</span> <a href=#handler-onload title=handler-onload>onload</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmessage title=handler-onmessage>onmessage</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousedown title=handler-onmousedown>onmousedown</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousemove title=handler-onmousemove>onmousemove</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseout title=handler-onmouseout>onmouseout</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseover title=handler-onmouseover>onmouseover</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmouseup title=handler-onmouseup>onmouseup</a>;
-           attribute <span>EventListener</span> <a href=#handler-onmousewheel title=handler-onmousewheel>onmousewheel</a>;
-           attribute <span>EventListener</span> <a href=#handler-onresize title=handler-onresize>onresize</a>;
-           attribute <span>EventListener</span> <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
-           attribute <span>EventListener</span> <a href=#handler-onselect title=handler-onselect>onselect</a>;
-           attribute <span>EventListener</span> <a href=#handler-onstorage title=handler-onstorage>onstorage</a>;
-           attribute <span>EventListener</span> <a href=#handler-onsubmit title=handler-onsubmit>onsubmit</a>;
-           attribute <span>EventListener</span> <a href=#handler-onunload title=handler-onunload>onunload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onabort title=handler-onabort>onabort</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onbeforeunload title=handler-onbeforeunload>onbeforeunload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onblur title=handler-onblur>onblur</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onchange title=handler-onchange>onchange</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onclick title=handler-onclick>onclick</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-oncontextmenu title=handler-oncontextmenu>oncontextmenu</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondblclick title=handler-ondblclick>ondblclick</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondrag title=handler-ondrag>ondrag</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragend title=handler-ondragend>ondragend</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragenter title=handler-ondragenter>ondragenter</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragleave title=handler-ondragleave>ondragleave</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragover title=handler-ondragover>ondragover</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondragstart title=handler-ondragstart>ondragstart</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-ondrop title=handler-ondrop>ondrop</a>;
+           attribute any <a href=#handler-onerror title=handler-onerror>onerror</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onfocus title=handler-onfocus>onfocus</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onhashchange title=handler-onhashchange>onhashchange</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeydown title=handler-onkeydown>onkeydown</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeypress title=handler-onkeypress>onkeypress</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onkeyup title=handler-onkeyup>onkeyup</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onload title=handler-onload>onload</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmessage title=handler-onmessage>onmessage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousedown title=handler-onmousedown>onmousedown</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousemove title=handler-onmousemove>onmousemove</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseout title=handler-onmouseout>onmouseout</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseover title=handler-onmouseover>onmouseover</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmouseup title=handler-onmouseup>onmouseup</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onmousewheel title=handler-onmousewheel>onmousewheel</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onresize title=handler-onresize>onresize</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onselect title=handler-onselect>onselect</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onstorage title=handler-onstorage>onstorage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onsubmit title=handler-onsubmit>onsubmit</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-onunload title=handler-onunload>onunload</a>;
 };</pre>
 
  <!-- XXX http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_window.asp
@@ -35032,7 +35033,7 @@
   attributes must initially be set to null. When their value changes
   (through the changing of their event handler content attribute or
   their event handler DOM attribute), they will either be null, or
-  have an <code>EventListener</code> object assigned to them.</p>
+  have a <code><a href=#function>Function</a></code> object assigned to them.</p>
 
   <p>Objects other than <code>Element</code> objects, in particular
   <code><a href=#window>Window</a></code>, only have <a href=#event-handler-dom-attributes title="event handler DOM
@@ -35052,21 +35053,35 @@
   <ol><li><p>Set up a <a href=#script-execution-environment>script execution environment</a> for
    JavaScript.</li>
 
-   <li><p>Using this script execution environment, interpret the
-   attribute's new value as the body of an anonymous function with a
-   single argument called <code>event</code>. Link the new function's
-   scope chain from the activation object of the handler, to the
-   element's object, to the element's <a href=#form-owner>form owner</a>, if it
-   has one, to the element's <code>Document</code> object, to the
-   <code><a href=#window>Window</a></code> object of the <a href=#browsing-context>browsing context</a> of
-   that <code>Document</code>. Set the function's <code>this</code>
-   parameter to the <code>Element</code> object representing the
-   element. Let this function be the only entry in the script's
-   <a href=#list-of-code-entry-points>list of code entry-points</a>.</p>
+   <li>
 
-   <p class=note>See ECMA262 Edition 3, sections 10.1.6 and 10.2.3,
-   for more details on activation objects. <a href=#refsECMA262>[ECMA262]</a></li>
+    <p>Using this script execution environment, interpret the
+    attribute's new value as the body of an anonymous function, with
+    the function's arguments set as follows:</p>
 
+    <dl class=switch><dt>If the attribute is <code title=handler-onerror><a href=#handler-onerror>onerror</a></code></dt>
+
+     <dd>Let the function have three arguments, named <code title="">event</code>, <code title="">source</code>, and <code title="">fileno</code>.</dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>Let the function have a single argument called <code title="">event</code>.</dd>
+
+    </dl><p>Link the new function's scope chain from the activation object
+    of the handler, to the element's object, to the element's
+    <a href=#form-owner>form owner</a>, if it has one, to the element's
+    <code>Document</code> object, to the <code><a href=#window>Window</a></code> object of
+    the <a href=#browsing-context>browsing context</a> of that
+    <code>Document</code>. Set the function's <code>this</code>
+    parameter to the <code>Element</code> object representing the
+    element. Let this function be the only entry in the script's
+    <a href=#list-of-code-entry-points>list of code entry-points</a>.</p>
+
+    <p class=note>See ECMA262 Edition 3, sections 10.1.6 and 10.2.3,
+    for more details on activation objects. <a href=#refsECMA262>[ECMA262]</a></p>
+
+   </li>
+
    <li><p>If the previous steps failed to compile the script, then set
    the corresponding event handler attribute to null and abort these
    steps.</li>
@@ -35075,9 +35090,8 @@
    <a href="#script's-browsing-context">script's browsing context</a>, the <a href="#script's-character-encoding">script's
    character encoding</a>, and the <a href="#script's-base-url">script's base URL</a>
    from <a href=#the-script-settings-determined-from-the-node>the script settings determined from the node</a> on
-   which the attribute is being set, and add the <a href=#concept-script title=concept-script>script</a> to the
-   <a href=#script-group>script group</a> determined from that node as
-   well.</li>
+   which the attribute is being set, and add the <a href=#concept-script title=concept-script>script</a> to the <a href=#script-group>script
+   group</a> determined from that node as well.</li>
 
    <li><p>Set the corresponding event handler attribute to the
    aforementioned function.</li>
@@ -35098,6 +35112,72 @@
   getting, must return whatever the current value of the corresponding
   event handler attribute is (possibly null).</p>
 
+  <hr><p>All event handler attributes on an element, whether set to null
+  or to a <code><a href=#function>Function</a></code> object<!-- or to anything else, in the
+  case of 'onerror' -->, 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 attribute's
+  element or object was created, with the event type (<var title=dom-event-type>type</var> argument) equal to the type
+  described for the event handler attribute in the list above, 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
+  nothing while the event handler attribute'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
+  attribute otherwise.</p>
+
+  <p class=note>The <var title=dom-event-listener>listener</var>
+  argument is emphatically <em>not</em> the event handler attribute
+  itself.</p>
+
+  <p>When an event handler attribute's <code><a href=#function>Function</a></code> objectw
+  is invoked, its <code title=dom-function-call><a href=#dom-function-call>call()</a></code>
+  callback must be invoked with one argument, set to the
+  <code>Event</code> object of the event in question.</p>
+
+  <p>The handler's return value must then be processed as follows:</p>
+
+  <dl class=switch><dt>If the event type is <code class=event-mouseover>mouseover</code></dt>
+
+   <dd><p>If the return value is a boolean with the value true, then
+   the event must be canceled.</dd>
+
+   <dt>If the event object is a <code><a href=#beforeunloadevent>BeforeUnloadEvent</a></code> object</dt>
+
+   <dd><p>If the return value is a string, and the event object's
+   <code title=dom-BeforeUnloadEvent-returnValue><a href=#dom-beforeunloadevent-returnvalue>returnValue</a></code>
+   attribute's value is the empty string, then set the <code title=dom-BeforeUnloadEvent-returnValue><a href=#dom-beforeunloadevent-returnvalue>returnValue</a></code>
+   attribute's value to the return value.</dd>
+
+   <dt>Otherwise</dt>
+
+   <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
+  scripting language being used. It is represented in IDL as
+  follows:</p>
+
+  <pre class=idl>[Callback=FunctionOnly, NoInterfaceObject]
+interface <dfn id=function>Function</dfn> {
+  any <a href=#dom-function-call title=dom-function-call>call</a>([Variadic] 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>
+
+
+
+  <h5 id=event-handler-attributes-on-elements-and-on-window-objects><span class=secno>5.4.6.2 </span>Event handler attributes on elements and on <code><a href=#window>Window</a></code> objects</h5>
+
   <p>The following are the event handler attributes that must be
   supported by all <a href=#html-elements>HTML elements</a>, as both content
   attributes and DOM attributes, and on <code><a href=#window>Window</a></code> objects,
@@ -35194,7 +35274,8 @@
    <dd><p>Must be invoked whenever an <code title=event-error><a href=#event-error>error</a></code> event is targeted at or bubbles
    through the element.</p>
 
-   <p>The initial value of <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> must be
+   <p>Unlike other event handler attributes, the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> event handler attribute can
+   have any value. The initial value of <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> must be
    <code>undefined</code>.</p>
 
    <p class=note>The <code title=handler-onerror><a href=#handler-onerror>onerror</a></code>
@@ -35312,49 +35393,8 @@
    <dd><p>Must be invoked whenever an <code title=event-unload>unload</code> event is targeted at or bubbles
    through the element.</dd>
 
-  </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.</p>
+  </dl><h5 id=event-firing><span class=secno>5.4.6.3 </span>Event firing</h5>
 
-  <p>The handler's return value must be processed as follows:</p>
-
-  <dl class=switch><dt>If the event type is <code class=event-mouseover>mouseover</code></dt>
-
-   <dd><p>If the return value is a boolean with the value true, then
-   the event must be canceled.</dd>
-
-   <dt>If the event object is a <code><a href=#beforeunloadevent>BeforeUnloadEvent</a></code> object</dt>
-
-   <dd><p>If the return value is a string, and the event object's
-   <code title=dom-BeforeUnloadEvent-returnValue><a href=#dom-beforeunloadevent-returnvalue>returnValue</a></code>
-   attribute's value is the empty string, then set the <code title=dom-BeforeUnloadEvent-returnValue><a href=#dom-beforeunloadevent-returnvalue>returnValue</a></code>
-   attribute's value to the return value.</dd>
-
-   <dt>Otherwise</dt>
-
-   <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 --><p>All event handler attributes on an element, whether set to null
-  or to a function, 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 element was created, with the
-  event type (<var title=dom-event-type>type</var> argument) equal
-  to the type described for the event handler attribute in the list
-  above, 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
-  nothing while the event handler attribute is null, and set to invoke
-  the function associated with the event handler attribute
-  otherwise. (The <var title=dom-event-listener>listener</var>
-  argument is emphatically <em>not</em> the event handler attribute
-  itself.)</p>
-
-
-  <h5 id=event-firing><span class=secno>5.4.6.2 </span>Event firing</h5>
-
   <p class=XXX>maybe this should be moved higher up
   (terminology? conformance? DOM?) Also, the whole terminology thing
   should be changed so that we don't define any specific events here,
@@ -35423,7 +35463,7 @@
   dispatched in expected ways.</p>
 
 
-  <h5 id=events-and-the-window-object><span class=secno>5.4.6.3 </span>Events and the <code><a href=#window>Window</a></code> object</h5>
+  <h5 id=events-and-the-window-object><span class=secno>5.4.6.4 </span>Events and the <code><a href=#window>Window</a></code> object</h5>
 
   <p>When an event is dispatched at a DOM node in a
   <code>Document</code> in a <a href=#browsing-context>browsing context</a>, if the
@@ -35439,7 +35479,7 @@
    <code><a href=#window>Window</a></code> object at the end of the phase, unless bubbling
    has been prevented.</li>
 
-  </ol><h5 id=runtime-script-errors><span class=secno>5.4.6.4 </span>Runtime script errors</h5>
+  </ol><h5 id=runtime-script-errors><span class=secno>5.4.6.5 </span>Runtime script errors</h5>
 
   <p><em>This section only applies to user agents that support
   scripting in general and ECMAScript in particular.</em></p>
@@ -35457,20 +35497,18 @@
   attribute <var title="">onerror</var>, it must run these steps,
   after which the error is either <i title="">handled</i> or <i title="">not handled</i>:</p>
 
-  <dl class=switch><dt>If the value of <var title="">onerror</var> is a function</dt>
+  <dl class=switch><dt>If the value of <var title="">onerror</var> is a
+   <code><a href=#function>Function</a></code></dt>
 
    <dd>
 
-    <p>The function referenced by the <var title="">onerror</var>
-    attribute must be invoked with three arguments.</p>
+    <p>The function must be invoked with three arguments. The three
+    arguments passed to the function are all <code>DOMString</code>s;
+    the first must give the message that the UA is considering
+    reporting, the second must give the <a href=#absolute-url>absolute URL</a> of
+    the resource in which the error occurred, and the third must give
+    the line number in that resource on which the error occurred.</p>
 
-    <p>The three arguments passed to the function are all
-    <code>DOMString</code>s; the first must give the message that the
-    UA is considering reporting, the second must give the
-    <a href=#absolute-url>absolute URL</a> of the resource in which the error
-    occurred, and the third must give the line number in that resource
-    on which the error occurred.</p>
-
     <p>If the function returns false, then the error is <i title="">handled</i>. Otherwise, the error is <i title="">not
     handled</i>.</p>
 
@@ -37593,14 +37631,14 @@
   void <a href=#dom-appcache-remove title=dom-appcache-remove>remove</a>(in DOMString url);
 
   // events
-           attribute <span>EventListener</span> <a href=#handler-appcache-onchecking title=handler-appcache-onchecking>onchecking</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-onerror title=handler-appcache-onerror>onerror</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-onnoupdate title=handler-appcache-onnoupdate>onnoupdate</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-ondownloading title=handler-appcache-ondownloading>ondownloading</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-onprogress title=handler-appcache-onprogress>onprogress</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-onupdateready title=handler-appcache-onupdateready>onupdateready</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-oncached title=handler-appcache-oncached>oncached</a>;
-           attribute <span>EventListener</span> <a href=#handler-appcache-onobsolete title=handler-appcache-onobsolete>onobsolete</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onchecking title=handler-appcache-onchecking>onchecking</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onerror title=handler-appcache-onerror>onerror</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onnoupdate title=handler-appcache-onnoupdate>onnoupdate</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-ondownloading title=handler-appcache-ondownloading>ondownloading</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onprogress title=handler-appcache-onprogress>onprogress</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onupdateready title=handler-appcache-onupdateready>onupdateready</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-oncached title=handler-appcache-oncached>oncached</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-appcache-onobsolete title=handler-appcache-onobsolete>onobsolete</a>;
 
 };</pre>
 
@@ -44561,9 +44599,9 @@
   readonly attribute long <a href=#dom-websocket-readystate title=dom-WebSocket-readyState>readyState</a>;
 
   // networking
-           attribute EventListener <a href=#handler-websocket-onopen title=handler-WebSocket-onopen>onopen</a>;
-           attribute EventListener <a href=#handler-websocket-onmessage title=handler-WebSocket-onmessage>onmessage</a>;
-           attribute EventListener <a href=#handler-websocket-onclosed title=handler-WebSocket-onclosed>onclosed</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-websocket-onopen title=handler-WebSocket-onopen>onopen</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-websocket-onmessage title=handler-WebSocket-onmessage>onmessage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-websocket-onclosed title=handler-WebSocket-onclosed>onclosed</a>;
   void <a href=#dom-websocket-postmessage title=dom-WebSocket-postMessage>postMessage</a>(in DOMString data);
   void <a href=#dom-websocket-disconnect title=dom-WebSocket-disconnect>disconnect</a>();
 };</pre>
@@ -45766,7 +45804,7 @@
   void <a href=#dom-messageport-close title=dom-MessagePort-close>close</a>();
 
   // event handler attributes
-           attribute <span>EventListener</span> <a href=#handler-messageport-onmessage title=handler-MessagePort-onmessage>onmessage</a>;
+           attribute <a href=#function>Function</a> <a href=#handler-messageport-onmessage title=handler-MessagePort-onmessage>onmessage</a>;
 };</pre>
 
   <p>Objects implementing the <code><a href=#messageport>MessagePort</a></code> interface must
@@ -45977,10 +46015,10 @@
     <p>Must be invoked whenever a <code title=event-MessagePort-message>message</code> event is targeted
     at or bubbles through the <code><a href=#messageport>MessagePort</a></code> object.</p>
 
-    <p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> attribute
-    is set, the port's <a href=#port-message-queue>port message queue</a> must be opened,
-    as if the <code title=dom-MessagePort-start><a href=#dom-messageport-start>start()</a></code>
-    method had been called.</p>
+    <p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> DOM
+    attribute is set, the port's <a href=#port-message-queue>port message queue</a> must
+    be opened, as if the <code title=dom-MessagePort-start><a href=#dom-messageport-start>start()</a></code> method had been
+    called.</p>
 
    </dd>
 

Modified: source
===================================================================
--- source	2009-01-21 00:58:10 UTC (rev 2683)
+++ source	2009-01-21 09:09:21 UTC (rev 2684)
@@ -6697,40 +6697,40 @@
   readonly attribute <span>CSSStyleDeclaration</span> <span title="dom-style">style</span>;
 
   // <span>event handler DOM attributes</span>
-           attribute <span>EventListener</span> <span title="handler-onabort">onabort</span>;
-           attribute <span>EventListener</span> <span title="handler-onbeforeunload">onbeforeunload</span>;
-           attribute <span>EventListener</span> <span title="handler-onblur">onblur</span>;
-           attribute <span>EventListener</span> <span title="handler-onchange">onchange</span>;
-           attribute <span>EventListener</span> <span title="handler-onclick">onclick</span>;
-           attribute <span>EventListener</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
-           attribute <span>EventListener</span> <span title="handler-ondblclick">ondblclick</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrag">ondrag</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragend">ondragend</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragenter">ondragenter</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragleave">ondragleave</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragover">ondragover</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragstart">ondragstart</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrop">ondrop</span>;
-           attribute <span>EventListener</span> <span title="handler-onerror">onerror</span>;
-           attribute <span>EventListener</span> <span title="handler-onfocus">onfocus</span>;
-           attribute <span>EventListener</span> <span title="handler-onhashchange">onhashchange</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeydown">onkeydown</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeypress">onkeypress</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeyup">onkeyup</span>;
-           attribute <span>EventListener</span> <span title="handler-onload">onload</span>;
-           attribute <span>EventListener</span> <span title="handler-onmessage">onmessage</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousedown">onmousedown</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousemove">onmousemove</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseout">onmouseout</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseover">onmouseover</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseup">onmouseup</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousewheel">onmousewheel</span>;
-           attribute <span>EventListener</span> <span title="handler-onresize">onresize</span>;
-           attribute <span>EventListener</span> <span title="handler-onscroll">onscroll</span>;
-           attribute <span>EventListener</span> <span title="handler-onselect">onselect</span>;
-           attribute <span>EventListener</span> <span title="handler-onstorage">onstorage</span>;
-           attribute <span>EventListener</span> <span title="handler-onsubmit">onsubmit</span>;
-           attribute <span>EventListener</span> <span title="handler-onunload">onunload</span>;
+           attribute <span>Function</span> <span title="handler-onabort">onabort</span>;
+           attribute <span>Function</span> <span title="handler-onbeforeunload">onbeforeunload</span>;
+           attribute <span>Function</span> <span title="handler-onblur">onblur</span>;
+           attribute <span>Function</span> <span title="handler-onchange">onchange</span>;
+           attribute <span>Function</span> <span title="handler-onclick">onclick</span>;
+           attribute <span>Function</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
+           attribute <span>Function</span> <span title="handler-ondblclick">ondblclick</span>;
+           attribute <span>Function</span> <span title="handler-ondrag">ondrag</span>;
+           attribute <span>Function</span> <span title="handler-ondragend">ondragend</span>;
+           attribute <span>Function</span> <span title="handler-ondragenter">ondragenter</span>;
+           attribute <span>Function</span> <span title="handler-ondragleave">ondragleave</span>;
+           attribute <span>Function</span> <span title="handler-ondragover">ondragover</span>;
+           attribute <span>Function</span> <span title="handler-ondragstart">ondragstart</span>;
+           attribute <span>Function</span> <span title="handler-ondrop">ondrop</span>;
+           attribute any <span title="handler-onerror">onerror</span>;
+           attribute <span>Function</span> <span title="handler-onfocus">onfocus</span>;
+           attribute <span>Function</span> <span title="handler-onhashchange">onhashchange</span>;
+           attribute <span>Function</span> <span title="handler-onkeydown">onkeydown</span>;
+           attribute <span>Function</span> <span title="handler-onkeypress">onkeypress</span>;
+           attribute <span>Function</span> <span title="handler-onkeyup">onkeyup</span>;
+           attribute <span>Function</span> <span title="handler-onload">onload</span>;
+           attribute <span>Function</span> <span title="handler-onmessage">onmessage</span>;
+           attribute <span>Function</span> <span title="handler-onmousedown">onmousedown</span>;
+           attribute <span>Function</span> <span title="handler-onmousemove">onmousemove</span>;
+           attribute <span>Function</span> <span title="handler-onmouseout">onmouseout</span>;
+           attribute <span>Function</span> <span title="handler-onmouseover">onmouseover</span>;
+           attribute <span>Function</span> <span title="handler-onmouseup">onmouseup</span>;
+           attribute <span>Function</span> <span title="handler-onmousewheel">onmousewheel</span>;
+           attribute <span>Function</span> <span title="handler-onresize">onresize</span>;
+           attribute <span>Function</span> <span title="handler-onscroll">onscroll</span>;
+           attribute <span>Function</span> <span title="handler-onselect">onselect</span>;
+           attribute <span>Function</span> <span title="handler-onstorage">onstorage</span>;
+           attribute <span>Function</span> <span title="handler-onsubmit">onsubmit</span>;
+           attribute <span>Function</span> <span title="handler-onunload">onunload</span>;
 
 };</pre>
 
@@ -38199,40 +38199,40 @@
   void <span title="dom-window-postMessage-3">postMessage</span>(in any message, in <span>MessagePort</span> messagePort, in DOMString targetOrigin);
 
   // <span>event handler DOM attributes</span>
-           attribute <span>EventListener</span> <span title="handler-onabort">onabort</span>;
-           attribute <span>EventListener</span> <span title="handler-onbeforeunload">onbeforeunload</span>;
-           attribute <span>EventListener</span> <span title="handler-onblur">onblur</span>;
-           attribute <span>EventListener</span> <span title="handler-onchange">onchange</span>;
-           attribute <span>EventListener</span> <span title="handler-onclick">onclick</span>;
-           attribute <span>EventListener</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
-           attribute <span>EventListener</span> <span title="handler-ondblclick">ondblclick</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrag">ondrag</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragend">ondragend</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragenter">ondragenter</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragleave">ondragleave</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragover">ondragover</span>;
-           attribute <span>EventListener</span> <span title="handler-ondragstart">ondragstart</span>;
-           attribute <span>EventListener</span> <span title="handler-ondrop">ondrop</span>;
-           attribute <span>EventListener</span> <span title="handler-onerror">onerror</span>;
-           attribute <span>EventListener</span> <span title="handler-onfocus">onfocus</span>;
-           attribute <span>EventListener</span> <span title="handler-onhashchange">onhashchange</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeydown">onkeydown</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeypress">onkeypress</span>;
-           attribute <span>EventListener</span> <span title="handler-onkeyup">onkeyup</span>;
-           attribute <span>EventListener</span> <span title="handler-onload">onload</span>;
-           attribute <span>EventListener</span> <span title="handler-onmessage">onmessage</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousedown">onmousedown</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousemove">onmousemove</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseout">onmouseout</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseover">onmouseover</span>;
-           attribute <span>EventListener</span> <span title="handler-onmouseup">onmouseup</span>;
-           attribute <span>EventListener</span> <span title="handler-onmousewheel">onmousewheel</span>;
-           attribute <span>EventListener</span> <span title="handler-onresize">onresize</span>;
-           attribute <span>EventListener</span> <span title="handler-onscroll">onscroll</span>;
-           attribute <span>EventListener</span> <span title="handler-onselect">onselect</span>;
-           attribute <span>EventListener</span> <span title="handler-onstorage">onstorage</span>;
-           attribute <span>EventListener</span> <span title="handler-onsubmit">onsubmit</span>;
-           attribute <span>EventListener</span> <span title="handler-onunload">onunload</span>;
+           attribute <span>Function</span> <span title="handler-onabort">onabort</span>;
+           attribute <span>Function</span> <span title="handler-onbeforeunload">onbeforeunload</span>;
+           attribute <span>Function</span> <span title="handler-onblur">onblur</span>;
+           attribute <span>Function</span> <span title="handler-onchange">onchange</span>;
+           attribute <span>Function</span> <span title="handler-onclick">onclick</span>;
+           attribute <span>Function</span> <span title="handler-oncontextmenu">oncontextmenu</span>;
+           attribute <span>Function</span> <span title="handler-ondblclick">ondblclick</span>;
+           attribute <span>Function</span> <span title="handler-ondrag">ondrag</span>;
+           attribute <span>Function</span> <span title="handler-ondragend">ondragend</span>;
+           attribute <span>Function</span> <span title="handler-ondragenter">ondragenter</span>;
+           attribute <span>Function</span> <span title="handler-ondragleave">ondragleave</span>;
+           attribute <span>Function</span> <span title="handler-ondragover">ondragover</span>;
+           attribute <span>Function</span> <span title="handler-ondragstart">ondragstart</span>;
+           attribute <span>Function</span> <span title="handler-ondrop">ondrop</span>;
+           attribute any <span title="handler-onerror">onerror</span>;
+           attribute <span>Function</span> <span title="handler-onfocus">onfocus</span>;
+           attribute <span>Function</span> <span title="handler-onhashchange">onhashchange</span>;
+           attribute <span>Function</span> <span title="handler-onkeydown">onkeydown</span>;
+           attribute <span>Function</span> <span title="handler-onkeypress">onkeypress</span>;
+           attribute <span>Function</span> <span title="handler-onkeyup">onkeyup</span>;
+           attribute <span>Function</span> <span title="handler-onload">onload</span>;
+           attribute <span>Function</span> <span title="handler-onmessage">onmessage</span>;
+           attribute <span>Function</span> <span title="handler-onmousedown">onmousedown</span>;
+           attribute <span>Function</span> <span title="handler-onmousemove">onmousemove</span>;
+           attribute <span>Function</span> <span title="handler-onmouseout">onmouseout</span>;
+           attribute <span>Function</span> <span title="handler-onmouseover">onmouseover</span>;
+           attribute <span>Function</span> <span title="handler-onmouseup">onmouseup</span>;
+           attribute <span>Function</span> <span title="handler-onmousewheel">onmousewheel</span>;
+           attribute <span>Function</span> <span title="handler-onresize">onresize</span>;
+           attribute <span>Function</span> <span title="handler-onscroll">onscroll</span>;
+           attribute <span>Function</span> <span title="handler-onselect">onselect</span>;
+           attribute <span>Function</span> <span title="handler-onstorage">onstorage</span>;
+           attribute <span>Function</span> <span title="handler-onsubmit">onsubmit</span>;
+           attribute <span>Function</span> <span title="handler-onunload">onunload</span>;
 };</pre>
 
  <!-- XXX http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_window.asp
@@ -39827,7 +39827,7 @@
   attributes must initially be set to null. When their value changes
   (through the changing of their event handler content attribute or
   their event handler DOM attribute), they will either be null, or
-  have an <code>EventListener</code> object assigned to them.</p>
+  have a <code>Function</code> object assigned to them.</p>
 
   <p>Objects other than <code>Element</code> objects, in particular
   <code>Window</code>, only have <span title="event handler DOM
@@ -39853,22 +39853,44 @@
    <li><p>Set up a <span>script execution environment</span> for
    JavaScript.</p></li>
 
-   <li><p>Using this script execution environment, interpret the
-   attribute's new value as the body of an anonymous function with a
-   single argument called <code>event</code>. Link the new function's
-   scope chain from the activation object of the handler, to the
-   element's object, to the element's <span>form owner</span>, if it
-   has one, to the element's <code>Document</code> object, to the
-   <code>Window</code> object of the <span>browsing context</span> of
-   that <code>Document</code>. Set the function's <code>this</code>
-   parameter to the <code>Element</code> object representing the
-   element. Let this function be the only entry in the script's
-   <span>list of code entry-points</span>.</p>
+   <li>
 
-   <p class="note">See ECMA262 Edition 3, sections 10.1.6 and 10.2.3,
-   for more details on activation objects. <a
-   href="#refsECMA262">[ECMA262]</a></p></li>
+    <p>Using this script execution environment, interpret the
+    attribute's new value as the body of an anonymous function, with
+    the function's arguments set as follows:</p>
 
+    <dl class="switch">
+
+     <dt>If the attribute is <code
+     title="handler-onerror">onerror</code></dt>
+
+     <dd>Let the function have three arguments, named <code
+     title="">event</code>, <code title="">source</code>, and <code
+     title="">fileno</code>.</dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>Let the function have a single argument called <code
+     title="">event</code>.</dd>
+
+    </dl>
+
+    <p>Link the new function's scope chain from the activation object
+    of the handler, to the element's object, to the element's
+    <span>form owner</span>, if it has one, to the element's
+    <code>Document</code> object, to the <code>Window</code> object of
+    the <span>browsing context</span> of that
+    <code>Document</code>. Set the function's <code>this</code>
+    parameter to the <code>Element</code> object representing the
+    element. Let this function be the only entry in the script's
+    <span>list of code entry-points</span>.</p>
+
+    <p class="note">See ECMA262 Edition 3, sections 10.1.6 and 10.2.3,
+    for more details on activation objects. <a
+    href="#refsECMA262">[ECMA262]</a></p>
+
+   </li>
+
    <li><p>If the previous steps failed to compile the script, then set
    the corresponding event handler attribute to null and abort these
    steps.</p></li>
@@ -39877,9 +39899,9 @@
    <span>script's browsing context</span>, the <span>script's
    character encoding</span>, and the <span>script's base URL</span>
    from <span>the script settings determined from the node</span> on
-   which the attribute is being set, and add the <span title="concept-script">script</span> to the
-   <span>script group</span> determined from that node as
-   well.</p></li>
+   which the attribute is being set, and add the <span
+   title="concept-script">script</span> to the <span>script
+   group</span> determined from that node as well.</p></li>
 
    <li><p>Set the corresponding event handler attribute to the
    aforementioned function.</p></li>
@@ -39904,6 +39926,87 @@
   getting, must return whatever the current value of the corresponding
   event handler attribute is (possibly null).</p>
 
+  <hr>
+
+  <p>All event handler attributes on an element, whether set to null
+  or to a <code>Function</code> object<!-- or to anything else, in the
+  case of 'onerror' -->, 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 attribute's
+  element or object was created, with the event type (<var
+  title="dom-event-type">type</var> argument) equal to the type
+  described for the event handler attribute in the list above, 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
+  nothing while the event handler attribute'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
+  attribute otherwise.</p>
+
+  <p class="note">The <var title="dom-event-listener">listener</var>
+  argument is emphatically <em>not</em> the event handler attribute
+  itself.</p>
+
+  <p>When an event handler attribute's <code>Function</code> objectw
+  is invoked, its <code title="dom-function-call">call()</code>
+  callback must be invoked with one argument, set to the
+  <code>Event</code> object of the event in question.</p>
+
+  <p>The handler's return value must then be processed as follows:</p>
+
+  <dl class="switch">
+
+   <dt>If the event type is <code class="event-mouseover">mouseover</code></dt>
+
+   <dd><p>If the return value is a boolean with the value true, then
+   the event must be canceled.</p></dd>
+
+   <dt>If the event object is a <code>BeforeUnloadEvent</code> object</dt>
+
+   <dd><p>If the return value is a string, and the event object's
+   <code title="dom-BeforeUnloadEvent-returnValue">returnValue</code>
+   attribute's value is the empty string, then set the <code
+   title="dom-BeforeUnloadEvent-returnValue">returnValue</code>
+   attribute's value to the return value.</p></dd>
+
+   <dt>Otherwise</dt>
+
+   <dd><p>If the return value is a boolean with the value false, then
+   the event must be canceled.</p></dd>
+
+  </dl>
+
+  <!-- IE actually uncancels the event if the function returns true -->
+
+  <hr>
+
+  <p>The <code>Function</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]
+interface <dfn>Function</dfn> {
+  any <span title="dom-function-call">call</span>([Variadic] in any arguments);
+};</pre>
+
+  <p>The <dfn 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>
+
+
+
+  <h5>Event handler attributes on elements and on <code>Window</code> objects</h5>
+
   <p>The following are the event handler attributes that must be
   supported by all <span>HTML elements</span>, as both content
   attributes and DOM attributes, and on <code>Window</code> objects,
@@ -40018,7 +40121,9 @@
    title="event-error">error</code> event is targeted at or bubbles
    through the element.</p>
 
-   <p>The initial value of <code
+   <p>Unlike other event handler attributes, the <code
+   title="handler-onerror">onerror</code> event handler attribute can
+   have any value. The initial value of <code
    title="handler-onerror">onerror</code> must be
    <code>undefined</code>.</p>
 
@@ -40158,58 +40263,8 @@
 
   </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.</p>
 
-  <p>The handler's return value must be processed as follows:</p>
 
-  <dl class="switch">
-
-   <dt>If the event type is <code class="event-mouseover">mouseover</code></dt>
-
-   <dd><p>If the return value is a boolean with the value true, then
-   the event must be canceled.</p></dd>
-
-   <dt>If the event object is a <code>BeforeUnloadEvent</code> object</dt>
-
-   <dd><p>If the return value is a string, and the event object's
-   <code title="dom-BeforeUnloadEvent-returnValue">returnValue</code>
-   attribute's value is the empty string, then set the <code
-   title="dom-BeforeUnloadEvent-returnValue">returnValue</code>
-   attribute's value to the return value.</p></dd>
-
-   <dt>Otherwise</dt>
-
-   <dd><p>If the return value is a boolean with the value false, then
-   the event must be canceled.</p></dd>
-
-  </dl>
-
-  <!-- IE actually uncancels the event if the function returns true -->
-
-  <p>All event handler attributes on an element, whether set to null
-  or to a function, 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 element was created, with the
-  event type (<var title="dom-event-type">type</var> argument) equal
-  to the type described for the event handler attribute in the list
-  above, 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
-  nothing while the event handler attribute is null, and set to invoke
-  the function associated with the event handler attribute
-  otherwise. (The <var title="dom-event-listener">listener</var>
-  argument is emphatically <em>not</em> the event handler attribute
-  itself.)</p>
-
-
   <h5>Event firing</h5>
 
   <p class="XXX">maybe this should be moved higher up
@@ -40345,20 +40400,18 @@
 
   <dl class="switch">
 
-   <dt>If the value of <var title="">onerror</var> is a function</dt>
+   <dt>If the value of <var title="">onerror</var> is a
+   <code>Function</code></dt>
 
    <dd>
 
-    <p>The function referenced by the <var title="">onerror</var>
-    attribute must be invoked with three arguments.</p>
+    <p>The function must be invoked with three arguments. The three
+    arguments passed to the function are all <code>DOMString</code>s;
+    the first must give the message that the UA is considering
+    reporting, the second must give the <span>absolute URL</span> of
+    the resource in which the error occurred, and the third must give
+    the line number in that resource on which the error occurred.</p>
 
-    <p>The three arguments passed to the function are all
-    <code>DOMString</code>s; the first must give the message that the
-    UA is considering reporting, the second must give the
-    <span>absolute URL</span> of the resource in which the error
-    occurred, and the third must give the line number in that resource
-    on which the error occurred.</p>
-
     <p>If the function returns false, then the error is <i
     title="">handled</i>. Otherwise, the error is <i title="">not
     handled</i>.</p>
@@ -40390,6 +40443,8 @@
 
 
 
+
+
   <h3>User prompts</h3>
 
   <h4>Simple dialogs</h4>
@@ -42766,14 +42821,14 @@
   void <span title="dom-appcache-remove">remove</span>(in DOMString url);
 
   // events
-           attribute <span>EventListener</span> <span title="handler-appcache-onchecking">onchecking</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-onerror">onerror</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-onnoupdate">onnoupdate</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-ondownloading">ondownloading</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-onprogress">onprogress</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-onupdateready">onupdateready</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-oncached">oncached</span>;
-           attribute <span>EventListener</span> <span title="handler-appcache-onobsolete">onobsolete</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onchecking">onchecking</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onerror">onerror</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onnoupdate">onnoupdate</span>;
+           attribute <span>Function</span> <span title="handler-appcache-ondownloading">ondownloading</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onprogress">onprogress</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onupdateready">onupdateready</span>;
+           attribute <span>Function</span> <span title="handler-appcache-oncached">oncached</span>;
+           attribute <span>Function</span> <span title="handler-appcache-onobsolete">onobsolete</span>;
 
 };</pre>
 
@@ -50825,9 +50880,9 @@
   readonly attribute long <span title="dom-WebSocket-readyState">readyState</span>;
 
   // networking
-           attribute EventListener <span title="handler-WebSocket-onopen">onopen</span>;
-           attribute EventListener <span title="handler-WebSocket-onmessage">onmessage</span>;
-           attribute EventListener <span title="handler-WebSocket-onclosed">onclosed</span>;
+           attribute <span>Function</span> <span title="handler-WebSocket-onopen">onopen</span>;
+           attribute <span>Function</span> <span title="handler-WebSocket-onmessage">onmessage</span>;
+           attribute <span>Function</span> <span title="handler-WebSocket-onclosed">onclosed</span>;
   void <span title="dom-WebSocket-postMessage">postMessage</span>(in DOMString data);
   void <span title="dom-WebSocket-disconnect">disconnect</span>();
 };</pre>
@@ -52254,7 +52309,7 @@
   void <span title="dom-MessagePort-close">close</span>();
 
   // event handler attributes
-           attribute <span>EventListener</span> <span title="handler-MessagePort-onmessage">onmessage</span>;
+           attribute <span>Function</span> <span title="handler-MessagePort-onmessage">onmessage</span>;
 };</pre>
 
   <p>Objects implementing the <code>MessagePort</code> interface must
@@ -52511,10 +52566,11 @@
     at or bubbles through the <code>MessagePort</code> object.</p>
 
     <p>The first time a <code>MessagePort</code> object's <code
-    title="handler-MessagePort-onmessage">onmessage</code> attribute
-    is set, the port's <span>port message queue</span> must be opened,
-    as if the <code title="dom-MessagePort-start">start()</code>
-    method had been called.</p>
+    title="handler-MessagePort-onmessage">onmessage</code> DOM
+    attribute is set, the port's <span>port message queue</span> must
+    be opened, as if the <code
+    title="dom-MessagePort-start">start()</code> method had been
+    called.</p>
 
    </dd>
 




More information about the Commit-Watchers mailing list