Skip to content

Commit

Permalink
[] (0) Simplify event terminology. Make 'load' events fired on the Wi…
Browse files Browse the repository at this point in the history
…ndow have the Document as the target.

git-svn-id: http://svn.whatwg.org/webapps@2989 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 26, 2009
1 parent 8cf70d2 commit 86fa645
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 71 deletions.
58 changes: 28 additions & 30 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -11532,8 +11532,8 @@ people expect to have work and what is necessary.

<li>

<p><a href=#fire-a-load-event>Fire a <code title=event-load>load</code>
event</a> at the <code><a href=#script>script</a></code> element.</p>
<p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#script>script</a></code>
element.</p>

</li>

Expand Down Expand Up @@ -16762,12 +16762,13 @@ interface <dfn id=htmlimageelement>HTMLImageElement</dfn> : <a href=#htmlelement
<p>The <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
source</a> once the resource has been <a href=#fetch title=fetch>fetched</a>, must, if the download was successful
and the image is <i>available</i>, <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-load-event>fire a <code title=event-load>load</code> event</a> on
the <code><a href=#the-img-element>img</a></code> element (this happens after <code title=dom-img-complete><a href=#dom-img-complete>complete</a></code> starts returning true); and
otherwise, if the fetching process fails without a response from the
remote server, or completes but the image is not a valid or
supported image, <a href=#queue-a-task>queue a task</a> to <a href=#fire-an-error-event>fire an <code title=event-error>error</code> event</a> on the
<code><a href=#the-img-element>img</a></code> element.</p>
<a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-img-element>img</a></code> element (this
happens after <code title=dom-img-complete><a href=#dom-img-complete>complete</a></code> starts
returning true); and otherwise, if the fetching process fails
without a response from the remote server, or completes but the
image is not a valid or supported image, <a href=#queue-a-task>queue a task</a>
to <a href=#fire-an-error-event>fire an <code title=event-error>error</code> event</a>
on the <code><a href=#the-img-element>img</a></code> element.</p>

<hr><p>What an <code><a href=#the-img-element>img</a></code> element represents depends on the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute and the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute.</p>

Expand Down Expand Up @@ -18033,9 +18034,10 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
name</a> must be set to the empty string.</p>

<p>When content loads in an <code><a href=#the-iframe-element>iframe</a></code>, after any <code title=event-load><a href=#event-load>load</a></code> events are fired within the content
itself, the user agent must <a href=#fire-a-load-event>fire a <code title=event-load>load</code> event</a> at the
<code><a href=#the-iframe-element>iframe</a></code> element. When content fails to load (e.g. due to
a network error), then the user agent must <a href=#fire-an-error-event>fire an <code title=event-error>error</code> event</a> at the element
itself, the user agent must <a href=#fire-a-simple-event>fire a simple event</a> called
<code title=event-load><a href=#event-load>load</a></code> at the <code><a href=#the-iframe-element>iframe</a></code>
element. When content fails to load (e.g. due to a network error),
then the user agent must <a href=#fire-an-error-event>fire an <code title=event-error>error</code> event</a> at the element
instead.</p>

<p>When there is an active parser in the <code><a href=#the-iframe-element>iframe</a></code>, and
Expand Down Expand Up @@ -18871,9 +18873,10 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
<li><p>The element's contents are not part of what the
<code><a href=#the-object-element>object</a></code> element represents.</p>

<li><p>Once the resource is completely loaded, <a href=#fire-a-load-event>fire a <code title=event-load>load</code> event</a> at the
element.</li> <!-- XXX ordering of events (like with iframe)
-->
<li><p>Once the resource is completely loaded, <a href=#fire-a-simple-event>fire a
simple event</a> called <code title=event-load><a href=#event-load>load</a></code>
at the element.</li> <!-- XXX ordering of events (like with
iframe) -->

</ol></li>

Expand Down Expand Up @@ -31483,7 +31486,7 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p>The <a href=#concept-task title=concept-task>task</a> that is <a href=#queue-a-task title="queue a task">queued</a> by the <a href=#networking-task-source>networking task
source</a> once the resource has been <a href=#fetch title=fetch>fetched</a>, must, if the download was successful
and the image is <i>available</i>, <a href=#queue-a-task>queue a task</a> to
<a href=#fire-a-load-event>fire a <code title=event-load>load</code> event</a> on
<a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-load><a href=#event-load>load</a></code> at
the <code><a href=#the-input-element>input</a></code> element; and otherwise, if the fetching
process fails without a response from the remote server, or
completes but the image is not a valid or supported image,
Expand Down Expand Up @@ -34579,7 +34582,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
<p>For each element <var title="">field</var> in <var title="">invalid controls</var>, if any, in <a href=#tree-order>tree
order</a>, run the following substeps:</p>

<ol><li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-invalid>invalid</code> at <var title="">field</var>.</li>
<ol><li><p><a href=#fire-a-simple-event>Fire a simple event</a> called <code title=event-invalid>invalid</code> at <var title="">field</var>.</li>

<li><p>If the event was not canceled, then add <var title="">field</var> to <var title="">unhandled invalid
controls</var>.</li>
Expand Down Expand Up @@ -34799,7 +34802,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
</dl><p>When the <dfn id=dom-cva-checkvalidatity title=dom-cva-checkValidatity><code>checkValidity()</code></dfn>
method is invoked, if the element is a <a href=#candidate-for-constraint-validation>candidate for
constraint validation</a> and does not <a href=#concept-fv-valid title=concept-fv-valid>satisfy its constraints</a>, the user
agent must <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-invalid>invalid</code> at the element and return
agent must <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-invalid>invalid</code> at the element and return
false. Otherwise, it must only return true without doing anything
else.</p>

Expand Down Expand Up @@ -35621,7 +35624,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
was to <a href=#broadcast-formchange-events>broadcast <code title=event-formchange>formchange</code> events</a>; let <var title="">event name</var> be <code title=event-formchange>formchange</code>.</li>

<li><p>For each element in <var title="">controls</var>, in
<a href=#tree-order>tree order</a>, <a href=#fire-a-simple-event>fire a simple event</a> named
<a href=#tree-order>tree order</a>, <a href=#fire-a-simple-event>fire a simple event</a> called
<var title="">event name</var> at the element.</li>

</ol></div>
Expand Down Expand Up @@ -42103,14 +42106,7 @@ interface <dfn id=function>Function</dfn> {
to the node on which the menu was fired, and with which the menu was
associated (which could be an ancestor of the former).</span></p>

<p><dfn id=fire-a-load-event title="fire a load event">Firing a <code title=event-load>load</code> event</dfn> means <a href=#fire-a-simple-event title="fire a
simple event">firing a simple event called <code title=event-load>load</code></a>. <!--<dfn title="fire a
DOMContentLoaded event">Firing a <code
title="event-DOMContentLoaded">DOMContentLoaded</code> event</dfn>
means <span title="fire a simple event">firing a simple event called
<code
title="event-DOMContentLoaded">DOMContentLoaded</code></span>.-->
<dfn id=fire-an-error-event title="fire an error event">Firing an <code title=event-error>error</code> event</dfn> means <a href=#fire-a-simple-event title="fire
<p><dfn id=fire-an-error-event title="fire an error event">Firing an <code title=event-error>error</code> event</dfn> means <a href=#fire-a-simple-event title="fire
a simple event">firing a simple event called <code title=event-error>error</code></a>.</p>

<!-- XXX need to define the dispatching of DOMActivate -->
Expand Down Expand Up @@ -58265,10 +58261,12 @@ interface <dfn id=messageport>MessagePort</dfn> {
readiness</a> to "complete".</li>

<li>If the <code>Document</code> is in a <a href=#browsing-context>browsing
context</a>, then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-load-event title="fire
a load event">fire a <code title=event-load>load</code>
event</a> at the <code>Document</code>'s <code><a href=#window>Window</a></code>
object.</li>
context</a>, then <a href=#queue-a-task>queue a task</a> to <a href=#fire-a-simple-event>fire a
simple event</a> called <code title=event-load><a href=#event-load>load</a></code> at
the <code>Document</code>'s <code><a href=#window>Window</a></code> object, but with
its <code title=dom-event-target>target</code> set to the
<code>Document</code> object (and the <code title=dom-event-currentTarget>currentTarget</code> set to the
<code><a href=#window>Window</a></code> object).</li>

<li>If the <code>Document</code> has a <a href=#pending-state-object>pending state
object</a>, then <a href=#queue-a-task>queue a task</a> to fire a <code title=event-popstate><a href=#event-popstate>popstate</a></code> event in no namespace on the
Expand Down
77 changes: 36 additions & 41 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -12300,8 +12300,9 @@ people expect to have work and what is necessary.

<li>

<p><span>Fire a <code title="event-load">load</code>
event</span> at the <code>script</code> element.</p>
<p><span>Fire a simple event</span> called <code
title="event-load">load</code> at the <code>script</code>
element.</p>

</li>

Expand Down Expand Up @@ -17990,14 +17991,14 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
source</span> once the resource has been <span
title="fetch">fetched</span>, must, if the download was successful
and the image is <i>available</i>, <span>queue a task</span> to
<span>fire a <code title="event-load">load</code> event</span> on
the <code>img</code> element (this happens after <code
title="dom-img-complete">complete</code> starts returning true); and
otherwise, if the fetching process fails without a response from the
remote server, or completes but the image is not a valid or
supported image, <span>queue a task</span> to <span>fire an <code
title="event-error">error</code> event</span> on the
<code>img</code> element.</p>
<span>fire a simple event</span> called <code
title="event-load">load</code> at the <code>img</code> element (this
happens after <code title="dom-img-complete">complete</code> starts
returning true); and otherwise, if the fetching process fails
without a response from the remote server, or completes but the
image is not a valid or supported image, <span>queue a task</span>
to <span>fire an <code title="event-error">error</code> event</span>
on the <code>img</code> element.</p>

<hr>

Expand Down Expand Up @@ -19349,10 +19350,10 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>

<p>When content loads in an <code>iframe</code>, after any <code
title="event-load">load</code> events are fired within the content
itself, the user agent must <span>fire a <code
title="event-load">load</code> event</span> at the
<code>iframe</code> element. When content fails to load (e.g. due to
a network error), then the user agent must <span>fire an <code
itself, the user agent must <span>fire a simple event</span> called
<code title="event-load">load</code> at the <code>iframe</code>
element. When content fails to load (e.g. due to a network error),
then the user agent must <span>fire an <code
title="event-error">error</code> event</span> at the element
instead.</p>

Expand Down Expand Up @@ -20293,10 +20294,10 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
<li><p>The element's contents are not part of what the
<code>object</code> element represents.</p>

<li><p>Once the resource is completely loaded, <span>fire a <code
title="event-load">load</code> event</span> at the
element.</p></li> <!-- XXX ordering of events (like with iframe)
-->
<li><p>Once the resource is completely loaded, <span>fire a
simple event</span> called <code title="event-load">load</code>
at the element.</p></li> <!-- XXX ordering of events (like with
iframe) -->

</ol>

Expand Down Expand Up @@ -35126,7 +35127,7 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
source</span> once the resource has been <span
title="fetch">fetched</span>, must, if the download was successful
and the image is <i>available</i>, <span>queue a task</span> to
<span>fire a <code title="event-load">load</code> event</span> on
<span>fire a simple event</span> called <code title="event-load">load</code> at
the <code>input</code> element; and otherwise, if the fetching
process fails without a response from the remote server, or
completes but the image is not a valid or supported image,
Expand Down Expand Up @@ -38887,7 +38888,7 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {

<ol>

<li><p><span>Fire a simple event</span> named <code
<li><p><span>Fire a simple event</span> called <code
title="event-invalid">invalid</code> at <var
title="">field</var>.</p></li>

Expand Down Expand Up @@ -39134,7 +39135,7 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
method is invoked, if the element is a <span>candidate for
constraint validation</span> and does not <span
title="concept-fv-valid">satisfy its constraints</span>, the user
agent must <span>fire a simple event</span> named <code
agent must <span>fire a simple event</span> called <code
title="event-invalid">invalid</code> at the element and return
false. Otherwise, it must only return true without doing anything
else.</p>
Expand Down Expand Up @@ -40149,7 +40150,7 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
title="event-formchange">formchange</code>.</li>

<li><p>For each element in <var title="">controls</var>, in
<span>tree order</span>, <span>fire a simple event</span> named
<span>tree order</span>, <span>fire a simple event</span> called
<var title="">event name</var> at the element.</p></li>

</ol>
Expand Down Expand Up @@ -47641,16 +47642,7 @@ interface <dfn>Function</dfn> {
to the node on which the menu was fired, and with which the menu was
associated (which could be an ancestor of the former).</span></p>

<p><dfn title="fire a load event">Firing a <code
title="event-load">load</code> event</dfn> means <span title="fire a
simple event">firing a simple event called <code
title="event-load">load</code></span>. <!--<dfn title="fire a
DOMContentLoaded event">Firing a <code
title="event-DOMContentLoaded">DOMContentLoaded</code> event</dfn>
means <span title="fire a simple event">firing a simple event called
<code
title="event-DOMContentLoaded">DOMContentLoaded</code></span>.-->
<dfn title="fire an error event">Firing an <code
<p><dfn title="fire an error event">Firing an <code
title="event-error">error</code> event</dfn> means <span title="fire
a simple event">firing a simple event called <code
title="event-error">error</code></span>.</p>
Expand Down Expand Up @@ -61281,15 +61273,15 @@ interface <dfn>EventSource</dfn> {
user agent must set the <code
title="dom-EventSource-readyState">readyState</code> attribute to
<code title="dom-EventSource-OPEN">OPEN</code> and <span>queue a
task</span> to <span>fire a simple event</span> named <code
task</span> to <span>fire a simple event</span> called <code
title="event-open">open</code> at the
<code>EventSource</code> object.</p>

<p>When a user agent is to <dfn>reset the connection</dfn>, the user
agent must set the <code
title="dom-EventSource-readyState">readyState</code> attribute to
<code title="dom-EventSource-CONNECTING">CONNECTING</code>,
<span>queue a task</span> to <span>fire a simple event</span> named
<span>queue a task</span> to <span>fire a simple event</span> called
<code title="event-error">error</code> at the
<code>EventSource</code> object, and then <span>fetch</span> the
event source resource again after a delay equal to the reconnection
Expand All @@ -61301,7 +61293,7 @@ interface <dfn>EventSource</dfn> {
agent must set the <code
title="dom-EventSource-readyState">readyState</code> attribute to
<code title="dom-EventSource-CLOSED">CLOSED</code> and <span>queue a
task</span> to <span>fire a simple event</span> named <code
task</span> to <span>fire a simple event</span> called <code
title="event-error">error</code> at the <code>EventSource</code>
object. <strong>Once the user agent has <span title="fail the
connection">failed the connection</span>, it does <em>not</em>
Expand Down Expand Up @@ -61887,7 +61879,7 @@ interface <dfn>WebSocket</dfn> {
<li>

<p><span>Queue a task</span> to <span>fire a simple event</span>
named <code title="event-open">open</code> at the
called <code title="event-open">open</code> at the
<code>WebSocket</code> object.</p>

</li>
Expand All @@ -61912,7 +61904,7 @@ interface <dfn>WebSocket</dfn> {
title="dom-WebSocket-readyState">readyState</code> attribute's value
must be changed to <code title="dom-WebSocket-CLOSED">CLOSED</code>
(2), and the user agent must <span>queue a task</span> to <span>fire
a simple event</span> named <code
a simple event</span> called <code
title="event-close">close</code> at the
<code>WebSocket</code> object.</p>

Expand Down Expand Up @@ -71035,10 +71027,13 @@ interface <dfn>MessagePort</dfn> {
readiness</span> to "complete".</li>

<li>If the <code>Document</code> is in a <span>browsing
context</span>, then <span>queue a task</span> to <span title="fire
a load event">fire a <code title="event-load">load</code>
event</span> at the <code>Document</code>'s <code>Window</code>
object.</li>
context</span>, then <span>queue a task</span> to <span>fire a
simple event</span> called <code title="event-load">load</code> at
the <code>Document</code>'s <code>Window</code> object, but with
its <code title="dom-event-target">target</code> set to the
<code>Document</code> object (and the <code
title="dom-event-currentTarget">currentTarget</code> set to the
<code>Window</code> object).</li>

<li>If the <code>Document</code> has a <span>pending state
object</span>, then <span>queue a task</span> to fire a <code
Expand Down

0 comments on commit 86fa645

Please sign in to comment.