HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2684Bring the event handler attribute stuff in line with reality. Make onerror='' and .onerror make sense and compatible with legacy content.2009-01-21 09:09
@@ -6690,54 +6690,54 @@ interface <dfn>HTMLDocument</dfn> {
   void <span title="dom-blur">blur</span>();
            attribute boolean <span title="dom-draggable">draggable</span>;
            attribute DOMString <span title="dom-contentEditable">contentEditable</span>;
   readonly attribute boolean <span title="dom-isContentEditable">isContentEditable</span>;
            attribute <span>HTMLMenuElement</span> <span title="dom-contextMenu">contextMenu</span>;
 
   // <span>styling</span>
   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>
 
   <p>The <code>HTMLElement</code> interface holds methods and
   attributes related to a number of disparate features, and the
   members of this interface are therefore described in various
   different sections of this specification.</p>
 
 
 
@@ -38192,54 +38192,54 @@ interface <dfn>Window</dfn> {
   DOMString <span title="dom-prompt">prompt</span>(in DOMString message, [Optional] in DOMString default);
   void <span title="dom-print">print</span>();
   any <span title="dom-showModalDialog">showModalDialog</span>(in DOMString url, [Optional] in any argument<!--, [Optional] in DOMString features-->);<!-- XXX-NOTIFY
   void <span title="dom-showNotification">showNotification</span>(in DOMString title, in DOMString subtitle, in DOMString description, [Optional] in VoidCallback onclick);-->
 
   // <span>cross-document messaging</span>
   void <span title="dom-window-postMessage-2">postMessage</span>(in any message, in DOMString targetOrigin);
   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
           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
           http://lxr.mozilla.org/mozilla/source/dom/public/idl/base/nsIDOMWindowInternal.idl - DOM level 0
    -->
 
   <p>The <dfn title="dom-window"><code>window</code></dfn>, <dfn
   title="dom-frames"><code>frames</code></dfn>, and <dfn
@@ -39820,21 +39820,21 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   specified. These act as bubbling event listeners for the element on
   which they are specified.</p>
 
   <p>On <span>HTML elements</span>, each event handler attribute has
   two parts, an <span title="event handler content attributes">event
   handler content attribute</span> and an <span title="event handler
   DOM attributes">event handler DOM attribute</span>. Event handler
   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
   attributes">event handler DOM attribute</span> (since they have no
   content attributes).</p>
 
   <hr>
 
   <p><dfn>Event handler content attributes</dfn>, when specified, must
   contain valid ECMAScript code matching the ECMAScript <code
@@ -39846,47 +39846,69 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   owned by a <code>Document</code> that is in a <span>browsing
   context</span>, the user agent must run the following steps to
   create a <span title="concept-script">script</span> after setting
   the content attribute to its new value:</p>
 
   <ol>
 
    <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>
-
-   <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>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>
 
    <li><p>Set up the <span>script's global object</span>, the
    <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>
 
   </ol>
 
   <p class="note">When an event handler content attribute is set on an
   element owned by a <code>Document</code> that is not in a
   <span>browsing context</span>, the corresponding event handler
   attribute is not changed.</p>
@@ -39897,20 +39919,101 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
 
   <p class="XXX">How do we allow non-JS event handlers?</p>
 
   <hr>
 
   <p><dfn>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>
 
+  <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,
   as DOM attributes:</p>
 
   <dl>
    <!-- XXX should change 'the element' below to 'the object' or something -->
 
    <dt><dfn title="handler-onabort"><code>onabort</code></dfn></dt>
 
@@ -40011,21 +40114,23 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
    <dd><p>Must be invoked whenever a <code
    title="event-drop">drop</code> event is targeted at or bubbles
    through the element.</p></dd>
 
    <dt><dfn title="handler-onerror"><code>onerror</code></dfn></dt> <!-- widely used -->
 
    <dd><p>Must be invoked whenever an <code
    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>
 
    <p class="note">The <code title="handler-onerror">onerror</code>
    handler is also used for <a href="#runtime-script-errors">reporting
    script errors</a>.</p></dd>
 
    <dt><dfn title="handler-onfocus"><code>onfocus</code></dfn></dt> <!-- widely used -->
 
    <dd><p>Must be invoked whenever a <code
@@ -40151,70 +40256,20 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
    through the element.</p></dd>
 
    <dt><dfn title="handler-onunload"><code>onunload</code></dfn></dt> <!-- widely used -->
 
    <dd><p>Must be invoked whenever an <code
    title="event-unload">unload</code> event is targeted at or bubbles
    through the element.</p></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>
-
-  <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
   (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
   event', and the like, and have the actual dispatch use those generic
   terms when firing events.</p>
@@ -40338,33 +40393,31 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   <hr>
 
   <p>When the user agent is required to <dfn 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>:</p>
 
   <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 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 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>If the function returns false, then the error is <i
     title="">handled</i>. Otherwise, the error is <i title="">not
     handled</i>.</p>
 
     <p>Any exceptions thrown or errors caused by this function must be
     reported to the user immediately after the error that the function
     was called for, without using the <span title="report the
     error">report an error</span> algorithm again.</p>
 
@@ -40383,20 +40436,22 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
    <dd>
 
     <p>The error is <i title="">not handled</i>.</p>
 
    </dd>
 
   </dl>
 
 
 
+
+
   <h3>User prompts</h3>
 
   <h4>Simple dialogs</h4>
 
   <p>The <dfn title="dom-alert"><code>alert(<var
   title="">message</var>)</code></dfn> method, when invoked, must show
   the given <var title="">message</var> to the user. The user agent
   may make the method wait for the user to acknowledge the message
   before returning; if so, the user agent must <span>pause</span>
   while the method is waiting.</p>
@@ -42759,28 +42814,28 @@ style/default.css</pre>
   void <span title="dom-appcache-update">update</span>();
   void <span title="dom-appcache-swapCache">swapCache</span>();
 
   // dynamic entries
   readonly attribute <span>DOMStringList</span> <span title="dom-appcache-items">items</span>;
   boolean <span title="dom-appcache-hasItem">hasItem</span>(in DOMString url);
   void <span title="dom-appcache-add">add</span>(in DOMString url);
   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>
 
   <p>Objects implementing the <code>ApplicationCache</code> interface
   must also implement the <code>EventTarget</code> interface.</p>
 
   <p>There is a one-to-one mapping from <code>Document</code> objects
   to <code>ApplicationCache</code> objects. The <dfn
   title="dom-applicationCache"><code>applicationCache</code></dfn>
   attribute on <code>Window</code> objects must return the
@@ -50818,23 +50873,23 @@ data:&nbsp;test</pre>
 interface <dfn>WebSocket</dfn> {
   readonly attribute DOMString <span title="dom-WebSocket-URL">URL</span>;
 
   // ready state
   const unsigned short <span title="dom-WebSocket-CONNECTING">CONNECTING</span> = 0;
   const unsigned short <span title="dom-WebSocket-OPEN">OPEN</span> = 1;
   const unsigned short <span title="dom-WebSocket-CLOSED">CLOSED</span> = 2;
   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>
 
   <p><code>WebSocket</code> objects must also implement the
   <code>EventTarget</code> interface. <a
   href="#refsDOM3EVENTS">[DOM3EVENTS]</a>
 
   <p>The <dfn title="dom-WebSocket"><code>WebSocket(<var
   title="">url</var>)</code></dfn> constructor takes one argument,
@@ -52247,21 +52302,21 @@ interface <dfn>MessageChannel</dfn> {
   received by the other port, and vice versa.</p>
 
   <pre class="idl">interface <dfn>MessagePort</dfn> {
   readonly attribute boolean <span title="dom-MessagePort-active">active</span>;
   void <span title="dom-MessagePort-postMessage">postMessage</span>(in any message, [Optional] in <span>MessagePort</span> messagePort);<!--
   <span>MessagePort</span> <span title="dom-MessagePort-startConversation">startConversation</span>(in any message);-->
   void <span title="dom-MessagePort-start">start</span>();
   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
   also implement the <code>EventTarget</code> interface.</p>
 
   <p>Each <code>MessagePort</code> object can be entangled with
   another (a symmetric relationship). Each <code>MessagePort</code>
   object also has a <span>task source</span> called the <dfn>port
   message queue</dfn>, initial empty. A <span>port message
   queue</span> can be open or closed, and is initially closed.</p>
@@ -52504,24 +52559,25 @@ interface <dfn>MessageChannel</dfn> {
 
    <dt><dfn title="handler-MessagePort-onmessage"><code>onmessage</code></dfn></dt>
 
    <dd>
 
     <p>Must be invoked whenever a <code
     title="event-MessagePort-message">message</code> event is targeted
     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>
 
   </dl>
 
 
 
   <h5>Ports and garbage collection</h5>
 
   <p>User agents must act as if <code>MessagePort</code> objects have

|