spec/Overview.html 1.1854 2684 Bring the event handler attribute stuff

Bring the event handler attribute stuff in line with reality. Make
onerror='' and .onerror make sense and compatible with legacy content.
(whatwg r2684)

Function
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#function
onunload
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#handler-onunload
WebSocket
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#websocket
5.4.6.4 Events and the Window object
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#events-and-the-window-object
onabort
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#handler-onabort
5.4.6.3 Event firing
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#event-firing
5.7.6 Application cache API
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#application-cache-api
MessagePort
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#messageport
call(...)
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#dom-function-call
5.4.6.5 Runtime script errors
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#runtime-script-errors
5.4.6.2 Event handler attributes on elements and on Window objects
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#event-handler-attributes-on-elements-and-on-window-objects
Window
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#window
onmessage
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#handler-messageport-onmessage
HTMLElement
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#htmlelement
onerror
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#handler-onerror
Firing a progress event called e
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#fire-a-progress-event
report an error
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#report-the-error
Event handler DOM attributes
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#event-handler-dom-attributes
5.4.6 Events
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#events
Event handler content attributes
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1854.html#event-handler-content-attributes

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1853&r2=1.1854&f=h
http://html5.org/tools/web-apps-tracker?from=2683&to=2684

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1853
retrieving revision 1.1854
diff -u -d -r1.1853 -r1.1854
--- Overview.html 21 Jan 2009 00:58:15 -0000 1.1853
+++ Overview.html 21 Jan 2009 09:09:26 -0000 1.1854
@@ -605,9 +605,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>
@@ -5479,40 +5480,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><p>The <code><a href=#htmlelement>HTMLElement</a></code> interface holds methods and
   attributes related to a number of disparate features, and the
@@ -27258,40 +27259,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
           http://www.mozilla.org/docs/dom/domref/dom_window_ref.html
           http://lxr.mozilla.org/mozilla/source/dom/public/idl/base/nsIDOMWindow.idl - scrollBy, etc
@@ -28427,7 +28428,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>Objects other than <code>Element</code> objects, in particular
+  have a <code><a href=#function>Function</a></code> object assigned to them.<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
   attributes">event handler DOM attribute</a> (since they have no
   content attributes).</p><hr><p><dfn id=event-handler-content-attributes>Event handler content attributes</dfn>, when specified, must
@@ -28438,20 +28439,34 @@
   the content attribute to its new value:<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=#references>[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=#references>[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
@@ -28461,9 +28476,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>
@@ -28475,7 +28489,53 @@
   reset the corresponding event handler attribute.</p><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cbody%20onload%3D%22w(%27pass%27)%22%3E%0A%3Cscript%3Edocument.body.removeAttribute(%27onload%27)%3B%3C%2Fscript%3E --><p class=XXX>How do we allow non-JS event handlers?</p><hr><p><dfn id=event-handler-dom-attributes>Event handler DOM attributes</dfn>, on setting, must set the
   corresponding event handler attribute to their new value, and on
   getting, must return whatever the current value of the corresponding
-  event handler attribute is (possibly null).<p>The following are the event handler attributes that must be
+  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 class=note>The <var title=dom-event-listener>listener</var>
+  argument is emphatically <em>not</em> the event handler attribute
+  itself.<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>The handler's return value must then be processed as follows:<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:<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 class=note>In JavaScript, any <code title="">Function</code>
+  object implements this interface.<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,
   as DOM attributes:<dl><!-- XXX should change 'the element' below to 'the object' or something --><dt><dfn id=handler-onabort title=handler-onabort><code>onabort</code></dfn></dt>
@@ -28569,7 +28629,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>
@@ -28687,41 +28748,7 @@
    <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>The handler's return value must be processed as follows:<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.)<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
+  </dl><h5 id=event-firing><span class=secno>5.4.6.3 </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,
   we only define 'simple event', 'progress event', 'mouse event', 'key
@@ -28766,7 +28793,7 @@
   triggered? If so, we need to go through the entire spec and make
   sure that any default actions are defined in terms of <em>any</em>
   event of the right type on that element, not those that are
-  dispatched in expected ways.<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><p>When an event is dispatched at a DOM node in a
+  dispatched in expected ways.<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
   event is not a <code title=event-load><a href=#event-load>load</a></code> event, the user
   agent must also dispatch the event to the <code><a href=#window>Window</a></code>, as
@@ -28778,7 +28805,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><p><em>This section only applies to user agents that support
+  </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>Whenever a runtime script error occurs in one of the scripts
   associated with the document, the user agent must <a href=#report-the-error>report the
   error</a> using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code>
@@ -28788,19 +28815,17 @@
   reported to the user.</p><hr><p>When the user agent is required to <dfn id=report-the-error title="report the
   error">report an error</dfn> <var title="">error</var> using the
   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>:<dl class=switch><dt>If the value of <var title="">onerror</var> is a function</dt>
+  after which the error is either <i title="">handled</i> or <i title="">not handled</i>:<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 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 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>If the function returns false, then the error is <i title="">handled</i>. Otherwise, the error is <i title="">not
     handled</i>.</p>
@@ -30684,14 +30709,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><p>Objects implementing the <code><a href=#applicationcache>ApplicationCache</a></code> interface
   must also implement the <code>EventTarget</code> interface.<p>There is a one-to-one mapping from <code>Document</code> objects
@@ -35853,9 +35878,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><p><code><a href=#websocket>WebSocket</a></code> objects must also implement the
@@ -36857,7 +36882,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
   also implement the <code>EventTarget</code> interface.<p>Each <code><a href=#messageport>MessagePort</a></code> object can be entangled with
   another (a symmetric relationship). Each <code><a href=#messageport>MessagePort</a></code>
@@ -37042,10 +37067,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>

Received on Wednesday, 21 January 2009 09:13:05 UTC