[html5] r7995 - [giow] (3) Revamp how errors are reported to be a little more sane and hopefully [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Jun 21 11:04:40 PDT 2013


Author: ianh
Date: 2013-06-21 11:04:38 -0700 (Fri, 21 Jun 2013)
New Revision: 7995

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Revamp how errors are reported to be a little more sane and hopefully slightly closer to more browsers (but there's not a huge amount of interop here and so this won't exactly match anything). This is a very risky change so let me know if anything broke.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=22310
Affected topics: HTML, Workers

Modified: complete.html
===================================================================
--- complete.html	2013-06-21 16:01:17 UTC (rev 7994)
+++ complete.html	2013-06-21 18:04:38 UTC (rev 7995)
@@ -967,7 +967,8 @@
        <li><a href=#killing-scripts><span class=secno>7.1.3.4 </span>Killing scripts</a></li>
        <li><a href=#runtime-script-errors><span class=secno>7.1.3.5 </span>Runtime script errors</a>
         <ol>
-         <li><a href=#runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</a></ol></ol></li>
+         <li><a href=#runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</a></li>
+         <li><a href=#the-errorevent-interface><span class=secno>7.1.3.5.2 </span>The <code>ErrorEvent</code> interface</a></ol></ol></li>
      <li><a href=#event-loops><span class=secno>7.1.4 </span>Event loops</a>
       <ol>
        <li><a href=#definitions-1><span class=secno>7.1.4.1 </span>Definitions</a></li>
@@ -9788,7 +9789,7 @@
 
    <dd><p><a href=#the-directionality>The directionality</a> of the element is '<a href=#concept-rtl title=concept-rtl>rtl</a>'.</dd>
 
-   <dt>If the element is an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-text>Text</a>, <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-search>Search</a>, <span title=attr-input-type-telephone>Telephone</span>, <a href="#url-state-(type=url)" title=attr-input-type-url>URL</a>, or <a href="#e-mail-state-(type=email)" title=attr-input-type-email>E-mail</a> state, and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
+   <dt>If the element is an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-text>Text</a>, <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-search>Search</a>, <a href="#telephone-state-(type=tel)" title=attr-input-type-tel>Telephone</a>, <a href="#url-state-(type=url)" title=attr-input-type-url>URL</a>, or <a href="#e-mail-state-(type=email)" title=attr-input-type-email>E-mail</a> state, and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
 
    <dt>If the element is a <code><a href=#the-textarea-element>textarea</a></code> element and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code>
    attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
@@ -71386,8 +71387,7 @@
     entry-point</a></i>.</p>
 
     <p>Otherwise, <a href=#report-the-error>report the error</a> for the <a href=#concept-script title=concept-script>script</a>,
-    with the problematic position (line number and column number), in the script's
-    <a href=#origin>origin</a>, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event handlers">event handler</a> of the <a href="#script's-global-object">script's global object</a>. If the
+    with the problematic position (line number and column number), using <a href="#script's-global-object">script's global object</a> as the target. If the
     error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error
     may be reported to the user.</p>
 
@@ -71480,76 +71480,117 @@
 
   <p>When the user agent is required to <dfn id=report-the-error title="report the error">report an error</dfn> for a
   particular <a href=#concept-script title=concept-script>script</a> <var title="">script</var> with a particular
-  position <var title="">line</var>:<var title="">col</var>, using the <a href=#event-handlers title="event
-  handlers">event handler</a> <var title="">onerror</var>, it must run these steps, after which
-  the error is either <dfn id=concept-error-handled title=concept-error-handled><i>handled</i></dfn> or <dfn id=concept-error-nothandled title=concept-error-nothandled><i>not handled</i></dfn>:</p>
+  position <var title="">line</var>:<var title="">col</var>, using a particular target <var title="">target</var>, it must run these steps, after which the error is either <dfn id=concept-error-handled title=concept-error-handled><i>handled</i></dfn> or <dfn id=concept-error-nothandled title=concept-error-nothandled><i>not
+  handled</i></dfn>:</p>
 
-  <dl class=switch><dt>If the value of <var title="">onerror</var> is an
-   <code><a href=#onerroreventhandler>OnErrorEventHandler</a></code></dt>
+  <ol><li><p>If <var title="">target</var> is <a href=#in-error-reporting-mode>in error reporting mode</a>, then abort these
+   steps; the error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</li>
 
-   <dd>
+   <li><p>Let <var title="">target</var> be <dfn id=in-error-reporting-mode>in error reporting mode</dfn>.</li>
 
-    <ol><li><p>Let <var title="">message</var> be a user-agent-defined
-     string describing the error in a helpful manner.</li>
+   <li><p>Let <var title="">message</var> be a user-agent-defined
+   string describing the error in a helpful manner.</li>
 
-     <li><p>If <var title="">script</var> has <a href=#muted-errors>muted errors</a>, then set <var title="">message</var> to "<code title="">Script error.</code>", set <var title="">location</var> to the empty string, and set <var title="">line</var> and <var title="">col</var> to 0.</li>
+   <li>
 
-     <li>
+    <p>Let <var title="">location</var> be an <a href=#absolute-url>absolute URL</a> that corresponds to the
+    resource from which <var title="">script</var> was obtained.</p>
 
-      <p>The callback must be invoked with four arguments: <var title="">message</var>, <var title="">location</var>, <var title="">line</var>, and <var title="">col</var>.</p>
+    <p class=note>The resource containing the script will typically be the file
+    from which the <code><a href=#document>Document</a></code> was parsed, e.g. for inline
+    <code><a href=#the-script-element>script</a></code> elements or <a href=#event-handler-content-attributes>event handler content
+    attributes</a>; or the JavaScript file that the script was in,
+    for external scripts. Even for dynamically-generated scripts, user
+    agents are strongly encouraged to attempt to keep track of the
+    original source of a script. For example, if an external script uses
+    the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> API to
+    insert an inline <code><a href=#the-script-element>script</a></code> element during parsing, the URL
+    of the resource containing the script would ideally be reported as
+    being the external script, and the line number might ideally be
+    reported as the line with the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> call or where the
+    string passed to that call was first constructed. Naturally,
+    implementing this can be somewhat non-trivial.</p>
 
-      <p>If the callback returns true, then the error is <i title=concept-error-handled><a href=#concept-error-handled>handled</a></i>. Otherwise, the error
-      is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+    <p class=note>User agents are similarly encouraged to keep careful track of the
+    original line numbers, even in the face of <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> calls mutating
+    the document as it is parsed, or <a href=#event-handler-content-attributes>event handler content
+    attributes</a> spanning multiple lines.</p>
 
-      <p>Any uncaught exceptions thrown or errors caused by this
-      function may be reported to the user immediately after the error
-      that the function was called for; the <a href=#report-the-error title="report the
-      error">report an error</a> algorithm must not be used to handle
-      exceptions thrown or errors caused by this function.</p>
+   </li>
 
-     </li>
+   <li><p>If <var title="">script</var> has <a href=#muted-errors>muted errors</a>, then set <var title="">message</var> to "<code title="">Script error.</code>", set <var title="">location</var> to the empty string, and set <var title="">line</var> and <var title="">col</var> to 0.</li>
 
-    </ol></dd>
+   <li><p>Let <var title="">event</var> be a new <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#errorevent>ErrorEvent</a></code> object that does not
+   bubble but is cancelable, and which has the event name <code title=event-error>error</code>.</li>
 
-   <dt>Otherwise</dt>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code> attribute to <var title="">message</var>.</li>
 
-   <dd>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code> attribute to <var title="">location</var>.</li>
 
-    <p>The error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code> attribute to <var title="">line</var>.</li>
 
-   </dd>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code> attribute to <var title="">col</var>.</li>
 
-  </dl><h6 id=runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</h6>
+   <li><p><a href=#concept-event-dispatch title=concept-event-dispatch>Dispatch</a> <var title="">event</var> at <var title="">target</var>.</li>
 
+   <li><p>Let <var title="">target</var> no longer be <a href=#in-error-reporting-mode>in error reporting mode</a>.</li>
+
+   <li><p>If <var title="">event</var> was canceled, then the error is <i title=concept-error-handled><a href=#concept-error-handled>handled</a></i>. Otherwise, the error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+
+  </ol><h6 id=runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</h6>
+
   <p>Whenever an uncaught runtime script error occurs in one of the scripts associated with a
   <code><a href=#document>Document</a></code>, the user agent must <a href=#report-the-error>report the error</a> for the relevant <a href=#concept-script title=concept-script>script</a>, with the problematic position (line number and column
-  number) in the resource containing the script, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event handlers">event handler</a> of
-  the <a href="#script's-global-object">script's global object</a>. If the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error may be reported to the
+  number) in the resource containing the script, using
+  the <a href="#script's-global-object">script's global object</a> as the target. If the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error may be reported to the
   user.</p>
 
-  <p>The resource containing the script will typically be the file
-  from which the <code><a href=#document>Document</a></code> was parsed, e.g. for inline
-  <code><a href=#the-script-element>script</a></code> elements or <a href=#event-handler-content-attributes>event handler content
-  attributes</a>; or the JavaScript file that the script was in,
-  for external scripts. Even for dynamically-generated scripts, user
-  agents are strongly encouraged to attempt to keep track of the
-  original source of a script. For example, if an external script uses
-  the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> API to
-  insert an inline <code><a href=#the-script-element>script</a></code> element during parsing, the URL
-  of the resource containing the script would ideally be reported as
-  being the external script, and the line number might ideally be
-  reported as the line with the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> call or where the
-  string passed to that call was first constructed. Naturally,
-  implementing this can be somewhat non-trivial.</p>
+  </div>
 
-  <p>User agents are similarly encouraged to keep careful track of the
-  original line numbers, even in the face of <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> calls mutating
-  the document as it is parsed, or <a href=#event-handler-content-attributes>event handler content
-  attributes</a> spanning multiple lines.</p>
 
-  </div>
 
+  <h6 id=the-errorevent-interface><span class=secno>7.1.3.5.2 </span>The <code><a href=#errorevent>ErrorEvent</a></code> interface</h6>
 
+  <pre class=idl>[Constructor(DOMString type, optional <a href=#erroreventinit>ErrorEventInit</a> eventInitDict)]
+interface <dfn id=errorevent>ErrorEvent</dfn> : <a href=#event>Event</a> {
+  readonly attribute DOMString <a href=#dom-errorevent-message title=dom-ErrorEvent-message>message</a>;
+  readonly attribute DOMString <a href=#dom-errorevent-filename title=dom-ErrorEvent-filename>filename</a>;
+  readonly attribute unsigned long <a href=#dom-errorevent-lineno title=dom-ErrorEvent-lineno>lineno</a>;
+  readonly attribute unsigned long <a href=#dom-errorevent-column title=dom-ErrorEvent-column>column</a>;
+};
+
+dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>EventInit</a> {
+  DOMString message;
+  DOMString filename;
+  unsigned long lineno;
+  unsigned long column;
+};</pre>
+
+  <p>The <dfn id=dom-errorevent-message title=dom-ErrorEvent-message><code>message</code></dfn> attribute
+  must return the value it was initialized to. When the object is
+  created, this attribute must be initialized to the empty string. It
+  represents the error message.</p>
+
+  <p>The <dfn id=dom-errorevent-filename title=dom-ErrorEvent-filename><code>filename</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to the empty
+  string. It represents the <a href=#absolute-url>absolute URL</a> of the script in
+  which the error originally occurred.</p>
+
+  <p>The <dfn id=dom-errorevent-lineno title=dom-ErrorEvent-lineno><code>lineno</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the line number where the error occurred in the
+  script.</p>
+
+  <p>The <dfn id=dom-errorevent-column title=dom-ErrorEvent-column><code>column</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the column number where the error occurred in the
+  script.</p>
+
+
+
   <div class=impl>
 
   <h4 id=event-loops><span class=secno>7.1.4 </span>Event loops</h4>
@@ -72243,24 +72284,53 @@
   <ol><li><p>If <var title="">H</var>'s value is null, then abort these steps.</li>
 
    <li><p>If <var title="">H</var>'s value is an <a href=#concept-handler-error title=concept-handler-error>internal error
-   value</a>, then set the <a href=#event-handlers title="event handlers">event handler</a> to null and then
+   value</a>, then: set the <a href=#event-handlers title="event handlers">event handler</a> to null and then
    <a href=#report-the-error>report the error</a> for the appropriate <a href=#concept-script title=concept-script>script</a> and
    with the appropriate position (line number and column number), as established when the error was
-   detected, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event
-   handlers">event handler</a> of the <code><a href=#window>Window</a></code> object of that <code><a href=#document>Document</a></code>,
-   and abort these steps.</li>
+   detected, using the <code><a href=#window>Window</a></code> object of that <code><a href=#document>Document</a></code> as the target. If
+   the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error
+   may be reported to the user. Finally, abort these steps.</li>
 
    <li><p>Let <var title="">callback</var> be <var title="">H</var>'s value, the callback that the
    <a href=#event-handlers title="event handlers">event handler</a> was last set to.</li>
 
-   <li><p>Invoke <var title="">callback</var> with one argument, the value of which is the
-   <code><a href=#event>Event</a></code> object <var title="">E</var>, with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></li>
+   <li>
 
+    <p>Process the <code><a href=#event>Event</a></code> object <var title="">E</var> as follows:</p>
+
+    <dl class=switch><dt>If <var title="">E</var> is an <code><a href=#errorevent>ErrorEvent</a></code> object and the <a href=#event-handler-idl-attributes title="event
+     handler IDL attributes">event handler IDL attribute</a>'s type is
+     <code><a href=#onerroreventhandler>OnErrorEventHandler</a></code></dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with four arguments,
+      the first one having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code> attribute,
+      the second having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code> attribute,
+      the third having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code> attribute, and
+      the fourth having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code> attribute,
+      with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return
+      value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
+     </dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with one argument, the value of which is the
+      <code><a href=#event>Event</a></code> object <var title="">E</var>, with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
+     </dd>
+
+    </dl></li>
+
    <li>
 
     <p>Process <var title="">return value</var> as follows:</p>
 
     <dl class=switch><dt>If the event type is <code class=event-mouseover>mouseover</code></dt>
+     <dt>If the event type is <code class=event-error>error</code> and <var title="">E</var> is an <code><a href=#errorevent>ErrorEvent</a></code> object</dt>
 
      <dd><p>If <var title="">return value</var> is a WebIDL boolean true value, then cancel the event.</dd>
 
@@ -72443,10 +72513,7 @@
     <tr><td><dfn id=handler-window-onresize title=handler-window-onresize><code>onresize</code></dfn> <td> <code title=event-resize>resize</code> <!-- widely used --> <!-- [CSSOM] -->
     <tr><td><dfn id=handler-window-onstorage title=handler-window-onstorage><code>onstorage</code></dfn> <td> <code title=event-storage><a href=#event-storage>storage</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-onunload title=handler-window-onunload><code>onunload</code></dfn> <td> <code title=event-unload>unload</code> <!-- widely used -->
-  </table><p class=note>The <code title=handler-onerror><a href=#handler-onerror>onerror</a></code>
-  handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
-
-  <hr><!-- this guy is only on Document and not on HTMLElement because
+  </table><hr><!-- this guy is only on Document and not on HTMLElement because
   otherwise HTMLScriptElement would have it and that causes
   compatibility issues since IE fires readystatechange events on
   <script>, not load events, and we can't fire both, and some sites
@@ -79474,7 +79541,7 @@
 
   void <a href=#dom-workerglobalscope-close title=dom-WorkerGlobalScope-close>close</a>();
 <!-- v2-onclose           attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-onclose">onclose</span>;
--->           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
+-->           attribute <a href=#onerroreventhandler>OnErrorEventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline>ononline</a>;
 
@@ -79915,17 +79982,15 @@
   <p>Whenever an uncaught runtime script error occurs in one of the worker's scripts, if the error
   did not occur while handling a previous script error, the user agent must <a href=#report-the-error>report the
   error</a> for that <a href=#concept-script title=concept-script>script</a>, with the position (line number
-  and column number) where the error occurred, using the <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object's
-  <code title=handler-WorkerGlobalScope-onerror><a href=#handler-workerglobalscope-onerror>onerror</a></code> attribute.
+  and column number) where the error occurred, using the <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object as the target.
   </p>
 
   <p>For shared workers, if the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>
-  afterwards, or if the error occurred while handling a previous script error, the error may be
-  reported to the user.
+  afterwards, the error may be reported to the user.
   </p>
 
   <p>For dedicated workers, if the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not
-  handled</a></i> afterwards, or if the error occurred while handling a previous script error, the user
+  handled</a></i> afterwards, the user
   agent must <a href=#queue-a-task>queue a task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event that uses the <code><a href=#errorevent>ErrorEvent</a></code>
   interface, with the name <code title=event-error>error</code>, that doesn't bubble and is
   cancelable, with its <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code>, <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code>, <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code>, and <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code>
@@ -79947,46 +80012,7 @@
   <p>The <a href=#task-source>task source</a> for the task mentioned above is the <a href=#dom-manipulation-task-source>DOM manipulation task
   source</a>.</p>
 
-  <hr><pre class=idl>[Constructor(DOMString type, optional <a href=#erroreventinit>ErrorEventInit</a> eventInitDict)]
-interface <dfn id=errorevent>ErrorEvent</dfn> : <a href=#event>Event</a> {
-  readonly attribute DOMString <a href=#dom-errorevent-message title=dom-ErrorEvent-message>message</a>;
-  readonly attribute DOMString <a href=#dom-errorevent-filename title=dom-ErrorEvent-filename>filename</a>;
-  readonly attribute unsigned long <a href=#dom-errorevent-lineno title=dom-ErrorEvent-lineno>lineno</a>;
-  readonly attribute unsigned long <a href=#dom-errorevent-column title=dom-ErrorEvent-column>column</a>;
-};
 
-dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>EventInit</a> {
-  DOMString message;
-  DOMString filename;
-  unsigned long lineno;
-  unsigned long column;
-};</pre>
-
-  <p>The <dfn id=dom-errorevent-message title=dom-ErrorEvent-message><code>message</code></dfn> attribute
-  must return the value it was initialized to. When the object is
-  created, this attribute must be initialized to the empty string. It
-  represents the error message.</p>
-
-  <p>The <dfn id=dom-errorevent-filename title=dom-ErrorEvent-filename><code>filename</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to the empty
-  string. It represents the <a href=#absolute-url>absolute URL</a> of the script in
-  which the error originally occurred.</p>
-
-  <p>The <dfn id=dom-errorevent-lineno title=dom-ErrorEvent-lineno><code>lineno</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the line number where the error occurred in the
-  script.</p>
-
-  <p>The <dfn id=dom-errorevent-column title=dom-ErrorEvent-column><code>column</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the column number where the error occurred in the
-  script.</p>
-
-
-
   <h4 id=creating-workers><span class=secno>9.2.6 </span>Creating workers</h4>
 
   <h5 id=the-abstractworker-abstract-interface><span class=secno>9.2.6.1 </span>The <code><a href=#abstractworker>AbstractWorker</a></code> abstract interface</h5>
@@ -100981,7 +101007,7 @@
 
     <tr><th id=ix-handler-onerror> <code title="">onerror</code>
      <td> <a href=#handler-onerror title=handler-onerror>HTML elements</a>
-     <td> <code title=event-error>error</code> event handler, and handler for <a href=#runtime-script-errors>script error notifications</a>
+     <td> <code title=event-error>error</code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
     <tr><th id=ix-handler-onfocus> <code title="">onfocus</code>

Modified: index
===================================================================
--- index	2013-06-21 16:01:17 UTC (rev 7994)
+++ index	2013-06-21 18:04:38 UTC (rev 7995)
@@ -967,7 +967,8 @@
        <li><a href=#killing-scripts><span class=secno>7.1.3.4 </span>Killing scripts</a></li>
        <li><a href=#runtime-script-errors><span class=secno>7.1.3.5 </span>Runtime script errors</a>
         <ol>
-         <li><a href=#runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</a></ol></ol></li>
+         <li><a href=#runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</a></li>
+         <li><a href=#the-errorevent-interface><span class=secno>7.1.3.5.2 </span>The <code>ErrorEvent</code> interface</a></ol></ol></li>
      <li><a href=#event-loops><span class=secno>7.1.4 </span>Event loops</a>
       <ol>
        <li><a href=#definitions-1><span class=secno>7.1.4.1 </span>Definitions</a></li>
@@ -9788,7 +9789,7 @@
 
    <dd><p><a href=#the-directionality>The directionality</a> of the element is '<a href=#concept-rtl title=concept-rtl>rtl</a>'.</dd>
 
-   <dt>If the element is an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-text>Text</a>, <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-search>Search</a>, <span title=attr-input-type-telephone>Telephone</span>, <a href="#url-state-(type=url)" title=attr-input-type-url>URL</a>, or <a href="#e-mail-state-(type=email)" title=attr-input-type-email>E-mail</a> state, and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
+   <dt>If the element is an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-text>Text</a>, <a href="#text-(type=text)-state-and-search-state-(type=search)" title=attr-input-type-search>Search</a>, <a href="#telephone-state-(type=tel)" title=attr-input-type-tel>Telephone</a>, <a href="#url-state-(type=url)" title=attr-input-type-url>URL</a>, or <a href="#e-mail-state-(type=email)" title=attr-input-type-email>E-mail</a> state, and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code> attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
 
    <dt>If the element is a <code><a href=#the-textarea-element>textarea</a></code> element and the <code title=attr-dir><a href=#the-dir-attribute>dir</a></code>
    attribute is in the <a href=#attr-dir-auto-state title=attr-dir-auto-state>auto</a> state</dt>
@@ -71386,8 +71387,7 @@
     entry-point</a></i>.</p>
 
     <p>Otherwise, <a href=#report-the-error>report the error</a> for the <a href=#concept-script title=concept-script>script</a>,
-    with the problematic position (line number and column number), in the script's
-    <a href=#origin>origin</a>, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event handlers">event handler</a> of the <a href="#script's-global-object">script's global object</a>. If the
+    with the problematic position (line number and column number), using <a href="#script's-global-object">script's global object</a> as the target. If the
     error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error
     may be reported to the user.</p>
 
@@ -71480,76 +71480,117 @@
 
   <p>When the user agent is required to <dfn id=report-the-error title="report the error">report an error</dfn> for a
   particular <a href=#concept-script title=concept-script>script</a> <var title="">script</var> with a particular
-  position <var title="">line</var>:<var title="">col</var>, using the <a href=#event-handlers title="event
-  handlers">event handler</a> <var title="">onerror</var>, it must run these steps, after which
-  the error is either <dfn id=concept-error-handled title=concept-error-handled><i>handled</i></dfn> or <dfn id=concept-error-nothandled title=concept-error-nothandled><i>not handled</i></dfn>:</p>
+  position <var title="">line</var>:<var title="">col</var>, using a particular target <var title="">target</var>, it must run these steps, after which the error is either <dfn id=concept-error-handled title=concept-error-handled><i>handled</i></dfn> or <dfn id=concept-error-nothandled title=concept-error-nothandled><i>not
+  handled</i></dfn>:</p>
 
-  <dl class=switch><dt>If the value of <var title="">onerror</var> is an
-   <code><a href=#onerroreventhandler>OnErrorEventHandler</a></code></dt>
+  <ol><li><p>If <var title="">target</var> is <a href=#in-error-reporting-mode>in error reporting mode</a>, then abort these
+   steps; the error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</li>
 
-   <dd>
+   <li><p>Let <var title="">target</var> be <dfn id=in-error-reporting-mode>in error reporting mode</dfn>.</li>
 
-    <ol><li><p>Let <var title="">message</var> be a user-agent-defined
-     string describing the error in a helpful manner.</li>
+   <li><p>Let <var title="">message</var> be a user-agent-defined
+   string describing the error in a helpful manner.</li>
 
-     <li><p>If <var title="">script</var> has <a href=#muted-errors>muted errors</a>, then set <var title="">message</var> to "<code title="">Script error.</code>", set <var title="">location</var> to the empty string, and set <var title="">line</var> and <var title="">col</var> to 0.</li>
+   <li>
 
-     <li>
+    <p>Let <var title="">location</var> be an <a href=#absolute-url>absolute URL</a> that corresponds to the
+    resource from which <var title="">script</var> was obtained.</p>
 
-      <p>The callback must be invoked with four arguments: <var title="">message</var>, <var title="">location</var>, <var title="">line</var>, and <var title="">col</var>.</p>
+    <p class=note>The resource containing the script will typically be the file
+    from which the <code><a href=#document>Document</a></code> was parsed, e.g. for inline
+    <code><a href=#the-script-element>script</a></code> elements or <a href=#event-handler-content-attributes>event handler content
+    attributes</a>; or the JavaScript file that the script was in,
+    for external scripts. Even for dynamically-generated scripts, user
+    agents are strongly encouraged to attempt to keep track of the
+    original source of a script. For example, if an external script uses
+    the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> API to
+    insert an inline <code><a href=#the-script-element>script</a></code> element during parsing, the URL
+    of the resource containing the script would ideally be reported as
+    being the external script, and the line number might ideally be
+    reported as the line with the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> call or where the
+    string passed to that call was first constructed. Naturally,
+    implementing this can be somewhat non-trivial.</p>
 
-      <p>If the callback returns true, then the error is <i title=concept-error-handled><a href=#concept-error-handled>handled</a></i>. Otherwise, the error
-      is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+    <p class=note>User agents are similarly encouraged to keep careful track of the
+    original line numbers, even in the face of <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> calls mutating
+    the document as it is parsed, or <a href=#event-handler-content-attributes>event handler content
+    attributes</a> spanning multiple lines.</p>
 
-      <p>Any uncaught exceptions thrown or errors caused by this
-      function may be reported to the user immediately after the error
-      that the function was called for; the <a href=#report-the-error title="report the
-      error">report an error</a> algorithm must not be used to handle
-      exceptions thrown or errors caused by this function.</p>
+   </li>
 
-     </li>
+   <li><p>If <var title="">script</var> has <a href=#muted-errors>muted errors</a>, then set <var title="">message</var> to "<code title="">Script error.</code>", set <var title="">location</var> to the empty string, and set <var title="">line</var> and <var title="">col</var> to 0.</li>
 
-    </ol></dd>
+   <li><p>Let <var title="">event</var> be a new <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#errorevent>ErrorEvent</a></code> object that does not
+   bubble but is cancelable, and which has the event name <code title=event-error>error</code>.</li>
 
-   <dt>Otherwise</dt>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code> attribute to <var title="">message</var>.</li>
 
-   <dd>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code> attribute to <var title="">location</var>.</li>
 
-    <p>The error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code> attribute to <var title="">line</var>.</li>
 
-   </dd>
+   <li><p>Initialize <var title="">event</var>'s <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code> attribute to <var title="">col</var>.</li>
 
-  </dl><h6 id=runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</h6>
+   <li><p><a href=#concept-event-dispatch title=concept-event-dispatch>Dispatch</a> <var title="">event</var> at <var title="">target</var>.</li>
 
+   <li><p>Let <var title="">target</var> no longer be <a href=#in-error-reporting-mode>in error reporting mode</a>.</li>
+
+   <li><p>If <var title="">event</var> was canceled, then the error is <i title=concept-error-handled><a href=#concept-error-handled>handled</a></i>. Otherwise, the error is <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>.</p>
+
+  </ol><h6 id=runtime-script-errors-in-documents><span class=secno>7.1.3.5.1 </span>Runtime script errors in documents</h6>
+
   <p>Whenever an uncaught runtime script error occurs in one of the scripts associated with a
   <code><a href=#document>Document</a></code>, the user agent must <a href=#report-the-error>report the error</a> for the relevant <a href=#concept-script title=concept-script>script</a>, with the problematic position (line number and column
-  number) in the resource containing the script, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event handlers">event handler</a> of
-  the <a href="#script's-global-object">script's global object</a>. If the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error may be reported to the
+  number) in the resource containing the script, using
+  the <a href="#script's-global-object">script's global object</a> as the target. If the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error may be reported to the
   user.</p>
 
-  <p>The resource containing the script will typically be the file
-  from which the <code><a href=#document>Document</a></code> was parsed, e.g. for inline
-  <code><a href=#the-script-element>script</a></code> elements or <a href=#event-handler-content-attributes>event handler content
-  attributes</a>; or the JavaScript file that the script was in,
-  for external scripts. Even for dynamically-generated scripts, user
-  agents are strongly encouraged to attempt to keep track of the
-  original source of a script. For example, if an external script uses
-  the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> API to
-  insert an inline <code><a href=#the-script-element>script</a></code> element during parsing, the URL
-  of the resource containing the script would ideally be reported as
-  being the external script, and the line number might ideally be
-  reported as the line with the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> call or where the
-  string passed to that call was first constructed. Naturally,
-  implementing this can be somewhat non-trivial.</p>
+  </div>
 
-  <p>User agents are similarly encouraged to keep careful track of the
-  original line numbers, even in the face of <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> calls mutating
-  the document as it is parsed, or <a href=#event-handler-content-attributes>event handler content
-  attributes</a> spanning multiple lines.</p>
 
-  </div>
 
+  <h6 id=the-errorevent-interface><span class=secno>7.1.3.5.2 </span>The <code><a href=#errorevent>ErrorEvent</a></code> interface</h6>
 
+  <pre class=idl>[Constructor(DOMString type, optional <a href=#erroreventinit>ErrorEventInit</a> eventInitDict)]
+interface <dfn id=errorevent>ErrorEvent</dfn> : <a href=#event>Event</a> {
+  readonly attribute DOMString <a href=#dom-errorevent-message title=dom-ErrorEvent-message>message</a>;
+  readonly attribute DOMString <a href=#dom-errorevent-filename title=dom-ErrorEvent-filename>filename</a>;
+  readonly attribute unsigned long <a href=#dom-errorevent-lineno title=dom-ErrorEvent-lineno>lineno</a>;
+  readonly attribute unsigned long <a href=#dom-errorevent-column title=dom-ErrorEvent-column>column</a>;
+};
+
+dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>EventInit</a> {
+  DOMString message;
+  DOMString filename;
+  unsigned long lineno;
+  unsigned long column;
+};</pre>
+
+  <p>The <dfn id=dom-errorevent-message title=dom-ErrorEvent-message><code>message</code></dfn> attribute
+  must return the value it was initialized to. When the object is
+  created, this attribute must be initialized to the empty string. It
+  represents the error message.</p>
+
+  <p>The <dfn id=dom-errorevent-filename title=dom-ErrorEvent-filename><code>filename</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to the empty
+  string. It represents the <a href=#absolute-url>absolute URL</a> of the script in
+  which the error originally occurred.</p>
+
+  <p>The <dfn id=dom-errorevent-lineno title=dom-ErrorEvent-lineno><code>lineno</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the line number where the error occurred in the
+  script.</p>
+
+  <p>The <dfn id=dom-errorevent-column title=dom-ErrorEvent-column><code>column</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the column number where the error occurred in the
+  script.</p>
+
+
+
   <div class=impl>
 
   <h4 id=event-loops><span class=secno>7.1.4 </span>Event loops</h4>
@@ -72243,24 +72284,53 @@
   <ol><li><p>If <var title="">H</var>'s value is null, then abort these steps.</li>
 
    <li><p>If <var title="">H</var>'s value is an <a href=#concept-handler-error title=concept-handler-error>internal error
-   value</a>, then set the <a href=#event-handlers title="event handlers">event handler</a> to null and then
+   value</a>, then: set the <a href=#event-handlers title="event handlers">event handler</a> to null and then
    <a href=#report-the-error>report the error</a> for the appropriate <a href=#concept-script title=concept-script>script</a> and
    with the appropriate position (line number and column number), as established when the error was
-   detected, using the <code title=handler-onerror><a href=#handler-onerror>onerror</a></code> <a href=#event-handlers title="event
-   handlers">event handler</a> of the <code><a href=#window>Window</a></code> object of that <code><a href=#document>Document</a></code>,
-   and abort these steps.</li>
+   detected, using the <code><a href=#window>Window</a></code> object of that <code><a href=#document>Document</a></code> as the target. If
+   the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i> after this, then the error
+   may be reported to the user. Finally, abort these steps.</li>
 
    <li><p>Let <var title="">callback</var> be <var title="">H</var>'s value, the callback that the
    <a href=#event-handlers title="event handlers">event handler</a> was last set to.</li>
 
-   <li><p>Invoke <var title="">callback</var> with one argument, the value of which is the
-   <code><a href=#event>Event</a></code> object <var title="">E</var>, with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></li>
+   <li>
 
+    <p>Process the <code><a href=#event>Event</a></code> object <var title="">E</var> as follows:</p>
+
+    <dl class=switch><dt>If <var title="">E</var> is an <code><a href=#errorevent>ErrorEvent</a></code> object and the <a href=#event-handler-idl-attributes title="event
+     handler IDL attributes">event handler IDL attribute</a>'s type is
+     <code><a href=#onerroreventhandler>OnErrorEventHandler</a></code></dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with four arguments,
+      the first one having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code> attribute,
+      the second having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code> attribute,
+      the third having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code> attribute, and
+      the fourth having the value of <var title="">E</var>'s <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code> attribute,
+      with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return
+      value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
+     </dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with one argument, the value of which is the
+      <code><a href=#event>Event</a></code> object <var title="">E</var>, with the <i title=dfn-callback-this-value>callback this value</i> set to <var title="">E</var>'s <code title=dom-Event-currentTarget>currentTarget</code>. Let the return value be <var title="">return value</var>. <a href=#refsWEBIDL>[WEBIDL]</a></p>
+
+     </dd>
+
+    </dl></li>
+
    <li>
 
     <p>Process <var title="">return value</var> as follows:</p>
 
     <dl class=switch><dt>If the event type is <code class=event-mouseover>mouseover</code></dt>
+     <dt>If the event type is <code class=event-error>error</code> and <var title="">E</var> is an <code><a href=#errorevent>ErrorEvent</a></code> object</dt>
 
      <dd><p>If <var title="">return value</var> is a WebIDL boolean true value, then cancel the event.</dd>
 
@@ -72443,10 +72513,7 @@
     <tr><td><dfn id=handler-window-onresize title=handler-window-onresize><code>onresize</code></dfn> <td> <code title=event-resize>resize</code> <!-- widely used --> <!-- [CSSOM] -->
     <tr><td><dfn id=handler-window-onstorage title=handler-window-onstorage><code>onstorage</code></dfn> <td> <code title=event-storage><a href=#event-storage>storage</a></code> <!-- new -->
     <tr><td><dfn id=handler-window-onunload title=handler-window-onunload><code>onunload</code></dfn> <td> <code title=event-unload>unload</code> <!-- widely used -->
-  </table><p class=note>The <code title=handler-onerror><a href=#handler-onerror>onerror</a></code>
-  handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
-
-  <hr><!-- this guy is only on Document and not on HTMLElement because
+  </table><hr><!-- this guy is only on Document and not on HTMLElement because
   otherwise HTMLScriptElement would have it and that causes
   compatibility issues since IE fires readystatechange events on
   <script>, not load events, and we can't fire both, and some sites
@@ -79474,7 +79541,7 @@
 
   void <a href=#dom-workerglobalscope-close title=dom-WorkerGlobalScope-close>close</a>();
 <!-- v2-onclose           attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-onclose">onclose</span>;
--->           attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
+-->           attribute <a href=#onerroreventhandler>OnErrorEventHandler</a> <a href=#handler-workerglobalscope-onerror title=handler-WorkerGlobalScope-onerror>onerror</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-onoffline title=handler-WorkerGlobalScope-onoffline>onoffline</a>;
            attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-workerglobalscope-ononline title=handler-WorkerGlobalScope-ononline>ononline</a>;
 
@@ -79915,17 +79982,15 @@
   <p>Whenever an uncaught runtime script error occurs in one of the worker's scripts, if the error
   did not occur while handling a previous script error, the user agent must <a href=#report-the-error>report the
   error</a> for that <a href=#concept-script title=concept-script>script</a>, with the position (line number
-  and column number) where the error occurred, using the <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object's
-  <code title=handler-WorkerGlobalScope-onerror><a href=#handler-workerglobalscope-onerror>onerror</a></code> attribute.
+  and column number) where the error occurred, using the <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object as the target.
   </p>
 
   <p>For shared workers, if the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not handled</a></i>
-  afterwards, or if the error occurred while handling a previous script error, the error may be
-  reported to the user.
+  afterwards, the error may be reported to the user.
   </p>
 
   <p>For dedicated workers, if the error is still <i title=concept-error-nothandled><a href=#concept-error-nothandled>not
-  handled</a></i> afterwards, or if the error occurred while handling a previous script error, the user
+  handled</a></i> afterwards, the user
   agent must <a href=#queue-a-task>queue a task</a> to <a href=#concept-event-fire title=concept-event-fire>fire</a> a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> event that uses the <code><a href=#errorevent>ErrorEvent</a></code>
   interface, with the name <code title=event-error>error</code>, that doesn't bubble and is
   cancelable, with its <code title=dom-ErrorEvent-message><a href=#dom-errorevent-message>message</a></code>, <code title=dom-ErrorEvent-filename><a href=#dom-errorevent-filename>filename</a></code>, <code title=dom-ErrorEvent-lineno><a href=#dom-errorevent-lineno>lineno</a></code>, and <code title=dom-ErrorEvent-column><a href=#dom-errorevent-column>column</a></code>
@@ -79947,46 +80012,7 @@
   <p>The <a href=#task-source>task source</a> for the task mentioned above is the <a href=#dom-manipulation-task-source>DOM manipulation task
   source</a>.</p>
 
-  <hr><pre class=idl>[Constructor(DOMString type, optional <a href=#erroreventinit>ErrorEventInit</a> eventInitDict)]
-interface <dfn id=errorevent>ErrorEvent</dfn> : <a href=#event>Event</a> {
-  readonly attribute DOMString <a href=#dom-errorevent-message title=dom-ErrorEvent-message>message</a>;
-  readonly attribute DOMString <a href=#dom-errorevent-filename title=dom-ErrorEvent-filename>filename</a>;
-  readonly attribute unsigned long <a href=#dom-errorevent-lineno title=dom-ErrorEvent-lineno>lineno</a>;
-  readonly attribute unsigned long <a href=#dom-errorevent-column title=dom-ErrorEvent-column>column</a>;
-};
 
-dictionary <dfn id=erroreventinit>ErrorEventInit</dfn> : <a href=#eventinit>EventInit</a> {
-  DOMString message;
-  DOMString filename;
-  unsigned long lineno;
-  unsigned long column;
-};</pre>
-
-  <p>The <dfn id=dom-errorevent-message title=dom-ErrorEvent-message><code>message</code></dfn> attribute
-  must return the value it was initialized to. When the object is
-  created, this attribute must be initialized to the empty string. It
-  represents the error message.</p>
-
-  <p>The <dfn id=dom-errorevent-filename title=dom-ErrorEvent-filename><code>filename</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to the empty
-  string. It represents the <a href=#absolute-url>absolute URL</a> of the script in
-  which the error originally occurred.</p>
-
-  <p>The <dfn id=dom-errorevent-lineno title=dom-ErrorEvent-lineno><code>lineno</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the line number where the error occurred in the
-  script.</p>
-
-  <p>The <dfn id=dom-errorevent-column title=dom-ErrorEvent-column><code>column</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the column number where the error occurred in the
-  script.</p>
-
-
-
   <h4 id=creating-workers><span class=secno>9.2.6 </span>Creating workers</h4>
 
   <h5 id=the-abstractworker-abstract-interface><span class=secno>9.2.6.1 </span>The <code><a href=#abstractworker>AbstractWorker</a></code> abstract interface</h5>
@@ -100981,7 +101007,7 @@
 
     <tr><th id=ix-handler-onerror> <code title="">onerror</code>
      <td> <a href=#handler-onerror title=handler-onerror>HTML elements</a>
-     <td> <code title=event-error>error</code> event handler, and handler for <a href=#runtime-script-errors>script error notifications</a>
+     <td> <code title=event-error>error</code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
     <tr><th id=ix-handler-onfocus> <code title="">onfocus</code>

Modified: source
===================================================================
--- source	2013-06-21 16:01:17 UTC (rev 7994)
+++ source	2013-06-21 18:04:38 UTC (rev 7995)
@@ -9713,7 +9713,7 @@
    title="attr-input-type">type</code> attribute is in the <span
    title="attr-input-type-text">Text</span>, <span
    title="attr-input-type-search">Search</span>, <span
-   title="attr-input-type-telephone">Telephone</span>, <span
+   title="attr-input-type-tel">Telephone</span>, <span
    title="attr-input-type-url">URL</span>, or <span
    title="attr-input-type-email">E-mail</span> state, and the <code
    title="attr-dir">dir</code> attribute is in the <span
@@ -79807,9 +79807,7 @@
     entry-point</i>.</p>
 
     <p>Otherwise, <span>report the error</span> for the <span title="concept-script">script</span>,
-    with the problematic position (line number and column number), in the script's
-    <span>origin</span>, using the <code title="handler-onerror">onerror</code> <span
-    title="event handlers">event handler</span> of the <span>script's global object</span>. If the
+    with the problematic position (line number and column number), using <span>script's global object</span> as the target. If the
     error is still <i title="concept-error-nothandled">not handled</i> after this, then the error
     may be reported to the user.</p>
 
@@ -79921,97 +79919,142 @@
 
   <p>When the user agent is required to <dfn title="report the error">report an error</dfn> for a
   particular <span title="concept-script">script</span> <var title="">script</var> with a particular
-  position <var title="">line</var>:<var title="">col</var>, using the <span title="event
-  handlers">event handler</span> <var title="">onerror</var>, it must run these steps, after which
-  the error is either <dfn title="concept-error-handled"><i>handled</i></dfn> or <dfn
-  title="concept-error-nothandled"><i>not handled</i></dfn>:</p>
+  position <var title="">line</var>:<var title="">col</var>, using a particular target <var
+  title="">target</var>, it must run these steps, after which the error is either <dfn
+  title="concept-error-handled"><i>handled</i></dfn> or <dfn title="concept-error-nothandled"><i>not
+  handled</i></dfn>:</p>
 
-  <dl class="switch">
+  <ol>
 
-   <dt>If the value of <var title="">onerror</var> is an
-   <code>OnErrorEventHandler</code></dt>
+   <li><p>If <var title="">target</var> is <span>in error reporting mode</span>, then abort these
+   steps; the error is <i title="concept-error-nothandled">not handled</i>.</p></li>
 
-   <dd>
+   <li><p>Let <var title="">target</var> be <dfn>in error reporting mode</dfn>.</p></li>
 
-    <ol>
+   <li><p>Let <var title="">message</var> be a user-agent-defined
+   string describing the error in a helpful manner.</p></li>
 
-     <li><p>Let <var title="">message</var> be a user-agent-defined
-     string describing the error in a helpful manner.</p></li>
+   <li>
 
-     <li><p>If <var title="">script</var> has <span>muted errors</span>, then set <var
-     title="">message</var> to "<code title="">Script error.</code>", set <var
-     title="">location</var> to the empty string, and set <var title="">line</var> and <var
-     title="">col</var> to 0.</p></li>
+    <p>Let <var title="">location</var> be an <span>absolute URL</span> that corresponds to the
+    resource from which <var title="">script</var> was obtained.</p>
 
-     <li>
+    <p class="note">The resource containing the script will typically be the file
+    from which the <code>Document</code> was parsed, e.g. for inline
+    <code>script</code> elements or <span>event handler content
+    attributes</span>; or the JavaScript file that the script was in,
+    for external scripts. Even for dynamically-generated scripts, user
+    agents are strongly encouraged to attempt to keep track of the
+    original source of a script. For example, if an external script uses
+    the <code title="dom-document-write">document.write()</code> API to
+    insert an inline <code>script</code> element during parsing, the URL
+    of the resource containing the script would ideally be reported as
+    being the external script, and the line number might ideally be
+    reported as the line with the <code
+    title="dom-document-write">document.write()</code> call or where the
+    string passed to that call was first constructed. Naturally,
+    implementing this can be somewhat non-trivial.</p>
 
-      <p>The callback must be invoked with four arguments: <var
-      title="">message</var>, <var title="">location</var>, <var
-      title="">line</var>, and <var title="">col</var>.</p>
+    <p class="note">User agents are similarly encouraged to keep careful track of the
+    original line numbers, even in the face of <code
+    title="dom-document-write">document.write()</code> calls mutating
+    the document as it is parsed, or <span>event handler content
+    attributes</span> spanning multiple lines.</p>
 
-      <p>If the callback returns true, then the error is <i
-      title="concept-error-handled">handled</i>. Otherwise, the error
-      is <i title="concept-error-nothandled">not handled</i>.</p>
+   </li>
 
-      <p>Any uncaught exceptions thrown or errors caused by this
-      function may be reported to the user immediately after the error
-      that the function was called for; the <span title="report the
-      error">report an error</span> algorithm must not be used to handle
-      exceptions thrown or errors caused by this function.</p>
+   <li><p>If <var title="">script</var> has <span>muted errors</span>, then set <var
+   title="">message</var> to "<code title="">Script error.</code>", set <var
+   title="">location</var> to the empty string, and set <var title="">line</var> and <var
+   title="">col</var> to 0.</p></li>
 
-     </li>
+   <li><p>Let <var title="">event</var> be a new <span
+   title="concept-events-trusted">trusted</span> <code>ErrorEvent</code> object that does not
+   bubble but is cancelable, and which has the event name <code
+   title="event-error">error</code>.</p></li>
 
-    </ol>
+   <li><p>Initialize <var title="">event</var>'s <code
+   title="dom-ErrorEvent-message">message</code> attribute to <var title="">message</var>.</p></li>
 
-   </dd>
+   <li><p>Initialize <var title="">event</var>'s <code
+   title="dom-ErrorEvent-filename">filename</code> attribute to <var title="">location</var>.</p></li>
 
-   <dt>Otherwise</dt>
+   <li><p>Initialize <var title="">event</var>'s <code
+   title="dom-ErrorEvent-lineno">lineno</code> attribute to <var title="">line</var>.</p></li>
 
-   <dd>
+   <li><p>Initialize <var title="">event</var>'s <code
+   title="dom-ErrorEvent-column">column</code> attribute to <var title="">col</var>.</p></li>
 
-    <p>The error is <i title="concept-error-nothandled">not handled</i>.</p>
+   <li><p><span title="concept-event-dispatch">Dispatch</span> <var title="">event</var> at <var
+   title="">target</var>.</p></li>
 
-   </dd>
+   <li><p>Let <var title="">target</var> no longer be <span>in error reporting mode</span>.</p></li>
 
-  </dl>
+   <li><p>If <var title="">event</var> was canceled, then the error is <i
+   title="concept-error-handled">handled</i>. Otherwise, the error is <i
+   title="concept-error-nothandled">not handled</i>.</p>
 
+  </ol>
 
+
   <h6>Runtime script errors in documents</h6>
 
   <p>Whenever an uncaught runtime script error occurs in one of the scripts associated with a
   <code>Document</code>, the user agent must <span>report the error</span> for the relevant <span
   title="concept-script">script</span>, with the problematic position (line number and column
-  number) in the resource containing the script, using the <code
-  title="handler-onerror">onerror</code> <span title="event handlers">event handler</span> of
-  the <span>script's global object</span>. If the error is still <i
+  number) in the resource containing the script, using
+  the <span>script's global object</span> as the target. If the error is still <i
   title="concept-error-nothandled">not handled</i> after this, then the error may be reported to the
   user.</p>
 
-  <p>The resource containing the script will typically be the file
-  from which the <code>Document</code> was parsed, e.g. for inline
-  <code>script</code> elements or <span>event handler content
-  attributes</span>; or the JavaScript file that the script was in,
-  for external scripts. Even for dynamically-generated scripts, user
-  agents are strongly encouraged to attempt to keep track of the
-  original source of a script. For example, if an external script uses
-  the <code title="dom-document-write">document.write()</code> API to
-  insert an inline <code>script</code> element during parsing, the URL
-  of the resource containing the script would ideally be reported as
-  being the external script, and the line number might ideally be
-  reported as the line with the <code
-  title="dom-document-write">document.write()</code> call or where the
-  string passed to that call was first constructed. Naturally,
-  implementing this can be somewhat non-trivial.</p>
+  </div>
 
-  <p>User agents are similarly encouraged to keep careful track of the
-  original line numbers, even in the face of <code
-  title="dom-document-write">document.write()</code> calls mutating
-  the document as it is parsed, or <span>event handler content
-  attributes</span> spanning multiple lines.</p>
 
-  </div>
 
+  <h6>The <code>ErrorEvent</code> interface</h6>
 
+  <pre class="idl">[Constructor(DOMString type, optional <span>ErrorEventInit</span> eventInitDict)]
+interface <dfn>ErrorEvent</dfn> : <span>Event</span> {
+  readonly attribute DOMString <span title="dom-ErrorEvent-message">message</span>;
+  readonly attribute DOMString <span title="dom-ErrorEvent-filename">filename</span>;
+  readonly attribute unsigned long <span title="dom-ErrorEvent-lineno">lineno</span>;
+  readonly attribute unsigned long <span title="dom-ErrorEvent-column">column</span>;
+};
+
+dictionary <dfn>ErrorEventInit</dfn> : <span>EventInit</span> {
+  DOMString message;
+  DOMString filename;
+  unsigned long lineno;
+  unsigned long column;
+};</pre>
+
+  <p>The <dfn
+  title="dom-ErrorEvent-message"><code>message</code></dfn> attribute
+  must return the value it was initialized to. When the object is
+  created, this attribute must be initialized to the empty string. It
+  represents the error message.</p>
+
+  <p>The <dfn
+  title="dom-ErrorEvent-filename"><code>filename</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to the empty
+  string. It represents the <span>absolute URL</span> of the script in
+  which the error originally occurred.</p>
+
+  <p>The <dfn title="dom-ErrorEvent-lineno"><code>lineno</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the line number where the error occurred in the
+  script.</p>
+
+  <p>The <dfn title="dom-ErrorEvent-column"><code>column</code></dfn>
+  attribute must return the value it was initialized to. When the
+  object is created, this attribute must be initialized to zero. It
+  represents the column number where the error occurred in the
+  script.</p>
+
+
+
   <div class="impl">
 
   <h4>Event loops</h4>
@@ -80825,22 +80868,55 @@
    <li><p>If <var title="">H</var>'s value is null, then abort these steps.</p></li>
 
    <li><p>If <var title="">H</var>'s value is an <span title="concept-handler-error">internal error
-   value</span>, then set the <span title="event handlers">event handler</span> to null and then
+   value</span>, then: set the <span title="event handlers">event handler</span> to null and then
    <span>report the error</span> for the appropriate <span title="concept-script">script</span> and
    with the appropriate position (line number and column number), as established when the error was
-   detected, using the <code title="handler-onerror">onerror</code> <span title="event
-   handlers">event handler</span> of the <code>Window</code> object of that <code>Document</code>,
-   and abort these steps.</p></li>
+   detected, using the <code>Window</code> object of that <code>Document</code> as the target. If
+   the error is still <i title="concept-error-nothandled">not handled</i> after this, then the error
+   may be reported to the user. Finally, abort these steps.</p></li>
 
    <li><p>Let <var title="">callback</var> be <var title="">H</var>'s value, the callback that the
    <span title="event handlers">event handler</span> was last set to.</p></li>
 
-   <li><p>Invoke <var title="">callback</var> with one argument, the value of which is the
-   <code>Event</code> object <var title="">E</var>, with the <i
-   title="dfn-callback-this-value">callback this value</i> set to <var title="">E</var>'s <code
-   title="dom-Event-currentTarget">currentTarget</code>. Let the return value be <var
-   title="">return value</var>. <a href="#refsWEBIDL">[WEBIDL]</a></p></li>
+   <li>
 
+    <p>Process the <code>Event</code> object <var title="">E</var> as follows:</p>
+
+    <dl class="switch">
+
+     <dt>If <var title="">E</var> is an <code>ErrorEvent</code> object and the <span title="event
+     handler IDL attributes">event handler IDL attribute</span>'s type is
+     <code>OnErrorEventHandler</code></dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with four arguments,
+      the first one having the value of <var title="">E</var>'s <code title="dom-ErrorEvent-message">message</code> attribute,
+      the second having the value of <var title="">E</var>'s <code title="dom-ErrorEvent-filename">filename</code> attribute,
+      the third having the value of <var title="">E</var>'s <code title="dom-ErrorEvent-lineno">lineno</code> attribute, and
+      the fourth having the value of <var title="">E</var>'s <code title="dom-ErrorEvent-column">column</code> attribute,
+      with the <i title="dfn-callback-this-value">callback this value</i> set to <var
+      title="">E</var>'s <code title="dom-Event-currentTarget">currentTarget</code>. Let the return
+      value be <var title="">return value</var>. <a href="#refsWEBIDL">[WEBIDL]</a></p>
+
+     </dd>
+
+     <dt>Otherwise</dt>
+
+     <dd>
+
+      <p>Invoke <var title="">callback</var> with one argument, the value of which is the
+      <code>Event</code> object <var title="">E</var>, with the <i
+      title="dfn-callback-this-value">callback this value</i> set to <var title="">E</var>'s <code
+      title="dom-Event-currentTarget">currentTarget</code>. Let the return value be <var
+      title="">return value</var>. <a href="#refsWEBIDL">[WEBIDL]</a></p>
+
+     </dd>
+
+    </dl>
+
+   </li>
+
    <li>
 
     <p>Process <var title="">return value</var> as follows:</p>
@@ -80848,6 +80924,7 @@
     <dl class="switch">
 
      <dt>If the event type is <code class="event-mouseover">mouseover</code></dt>
+     <dt>If the event type is <code class="event-error">error</code> and <var title="">E</var> is an <code>ErrorEvent</code> object</dt>
 
      <dd><p>If <var title="">return value</var> is a WebIDL boolean true value, then cancel the event.</p></dd>
 
@@ -81058,10 +81135,6 @@
     <tr><td><dfn title="handler-window-onunload"><code>onunload</code></dfn> <td> <code title="event-unload">unload</code> <!-- widely used -->
   </table>
 
-  <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>
-
   <hr>
 
   <!-- this guy is only on Document and not on HTMLElement because
@@ -88457,7 +88530,7 @@
 
   void <span title="dom-WorkerGlobalScope-close">close</span>();
 <!-- v2-onclose           attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-onclose">onclose</span>;
--->           attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-onerror">onerror</span>;
+-->           attribute <span>OnErrorEventHandler</span> <span title="handler-WorkerGlobalScope-onerror">onerror</span>;
            attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-onoffline">onoffline</span>;
            attribute <span>EventHandler</span> <span title="handler-WorkerGlobalScope-ononline">ononline</span>;
 };</pre>
@@ -88967,23 +89040,21 @@
   <p>Whenever an uncaught runtime script error occurs in one of the worker's scripts, if the error
   did not occur while handling a previous script error, the user agent must <span>report the
   error</span> for that <span title="concept-script">script</span>, with the position (line number
-  and column number) where the error occurred, using the <code>WorkerGlobalScope</code> object's
-  <code title="handler-WorkerGlobalScope-onerror">onerror</code> attribute.
+  and column number) where the error occurred, using the <code>WorkerGlobalScope</code> object as the target.
   <!--END complete-->
   <a href="#refsHTML">[HTML]</a>
   <!--START complete-->
   </p>
 
   <p>For shared workers, if the error is still <i title="concept-error-nothandled">not handled</i>
-  afterwards, or if the error occurred while handling a previous script error, the error may be
-  reported to the user.
+  afterwards, the error may be reported to the user.
   <!--END complete-->
   <a href="#refsHTML">[HTML]</a>
   <!--START complete-->
   </p>
 
   <p>For dedicated workers, if the error is still <i title="concept-error-nothandled">not
-  handled</i> afterwards, or if the error occurred while handling a previous script error, the user
+  handled</i> afterwards, the user
   agent must <span>queue a task</span> to <span title="concept-event-fire">fire</span> a <span
   title="concept-events-trusted">trusted</span> event that uses the <code>ErrorEvent</code>
   interface, with the name <code title="event-error">error</code>, that doesn't bubble and is
@@ -89008,50 +89079,7 @@
   <p>The <span>task source</span> for the task mentioned above is the <span>DOM manipulation task
   source</span>.</p>
 
-  <hr>
 
-  <pre class="idl">[Constructor(DOMString type, optional <span>ErrorEventInit</span> eventInitDict)]
-interface <dfn>ErrorEvent</dfn> : <span>Event</span> {
-  readonly attribute DOMString <span title="dom-ErrorEvent-message">message</span>;
-  readonly attribute DOMString <span title="dom-ErrorEvent-filename">filename</span>;
-  readonly attribute unsigned long <span title="dom-ErrorEvent-lineno">lineno</span>;
-  readonly attribute unsigned long <span title="dom-ErrorEvent-column">column</span>;
-};
-
-dictionary <dfn>ErrorEventInit</dfn> : <span>EventInit</span> {
-  DOMString message;
-  DOMString filename;
-  unsigned long lineno;
-  unsigned long column;
-};</pre>
-
-  <p>The <dfn
-  title="dom-ErrorEvent-message"><code>message</code></dfn> attribute
-  must return the value it was initialized to. When the object is
-  created, this attribute must be initialized to the empty string. It
-  represents the error message.</p>
-
-  <p>The <dfn
-  title="dom-ErrorEvent-filename"><code>filename</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to the empty
-  string. It represents the <span>absolute URL</span> of the script in
-  which the error originally occurred.</p>
-
-  <p>The <dfn title="dom-ErrorEvent-lineno"><code>lineno</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the line number where the error occurred in the
-  script.</p>
-
-  <p>The <dfn title="dom-ErrorEvent-column"><code>column</code></dfn>
-  attribute must return the value it was initialized to. When the
-  object is created, this attribute must be initialized to zero. It
-  represents the column number where the error occurred in the
-  script.</p>
-
-
-
   <h4>Creating workers</h4>
 
   <h5>The <code>AbstractWorker</code> abstract interface</h5>
@@ -113054,7 +113082,7 @@
     <tr>
      <th id="ix-handler-onerror"> <code title="">onerror</code>
      <td> <span title="handler-onerror">HTML elements</span>
-     <td> <code title="event-error">error</code> event handler, and handler for <a href="#runtime-script-errors">script error notifications</a>
+     <td> <code title="event-error">error</code> event handler
      <td> <span title="event handler content attributes">Event handler content attribute</span>
 
     <tr>




More information about the Commit-Watchers mailing list