Skip to content

Commit

Permalink
[e] (0) Restructure the script execution algorithm to be more clear. …
Browse files Browse the repository at this point in the history
…Fix a cross-reference problem in the appcache section.

git-svn-id: http://svn.whatwg.org/webapps@1604 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 14, 2008
1 parent 4594364 commit 94e1456
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 83 deletions.
100 changes: 59 additions & 41 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<h1 id=html-5>HTML 5</h1>

<h2 class="no-num no-toc" id=draft>Draft Recommendation &mdash; 13 May
<h2 class="no-num no-toc" id=draft>Draft Recommendation &mdash; 14 May
2008</h2>

<p>You can take part in this work. <a
Expand Down Expand Up @@ -22883,47 +22883,65 @@ XXXDVT (also check for '- -' bits in the part above) -->
<code title=event-load>load</code> event</a>.

<p><dfn id=executing0 title="executing a script block">Executing a script
block</dfn>: If the load resulted in an error (for example a DNS error, or
an HTTP 404 error), then executing the script must just consist of <a
href="#firing5" title="fire an error event">firing an <code
title=event-error>error</code> event</a> at the element.
block</dfn>:

<p>If the load was successful, then first the user agent must <a
href="#firing4">fire a <code title=event-load>load</code> event</a> at the
element, and then, if <a href="#scripting2">scripting is enabled</a>, and
the <code>Document</code> does not have <code
title=dom-document-designMode><a href="#designMode">designMode</a></code>
enabled, and the <code>Document</code> is the <a href="#active">active
document</a> in its <a href="#browsing1">browsing context</a>, the user
agent must execute the script:

<p>If the script is from an external file, then that file must be used as
the file to execute.

<p>If the script is inline, then, for scripting languages that consist of
pure text, user agents must use the value of the DOM <code
title=dom-script-text><a href="#text1">text</a></code> attribute (defined
below) as the script to execute, and for XML-based scripting languages,
user agents must use all the child nodes of the <code><a
href="#script0">script</a></code> element as the script to execute.

<p>In any case, the user agent must execute the script according to the
semantics defined by the language associated with <var><a
href="#the-scripts">the script's type</a></var> (see the <a
href="#scriptingLanguages">scripting languages</a> section below).

<p>Scripts must be executed in the scope of the <a
href="#browsing1">browsing context</a> of the element's
<code>Document</code>.
<dl class=switch>
<dt>If the load resulted in an error (for example a DNS error, or an HTTP
404 error)

<dd>
<p>Executing the script must just consist of <a href="#firing5"
title="fire an error event">firing an <code
title=event-error>error</code> event</a> at the element.

<dt>If the load was successful

<dd>
<p>First the user agent must <a href="#firing4">fire a <code
title=event-load>load</code> event</a> at the element, and then, if <a
href="#scripting2">scripting is enabled</a>, and the
<code>Document</code> does not have <code
title=dom-document-designMode><a
href="#designMode">designMode</a></code> enabled, and the
<code>Document</code> is the <a href="#active">active document</a> in
its <a href="#browsing1">browsing context</a>, the user agent must
execute the script:</p>

<p class=note>The element's attributes' values might have changed between
when the element was inserted into the document and when the script has
finished loading, as may its other attributes; similarly, the element
itself might have been taken back out of the DOM, or had other changes
made. These changes do not in any way affect the above steps; only the
values of the attributes at the time the <code><a
href="#script0">script</a></code> element is first inserted into the
document matter.
<dl class=switch>
<dt>If the script is from an external file

<dd>
<p>That file must be used as the file to execute.</p>

<dt>If the script is inline

<dd>
<p>For scripting languages that consist of pure text, user agents must
use the value of the DOM <code title=dom-script-text><a
href="#text1">text</a></code> attribute (defined below) as the script
to execute, and for XML-based scripting languages, user agents must
use all the child nodes of the <code><a
href="#script0">script</a></code> element as the script to execute.</p>
</dl>

<p>In any case, the user agent must execute the script according to the
semantics defined by the language associated with <var><a
href="#the-scripts">the script's type</a></var> (see the <a
href="#scriptingLanguages">scripting languages</a> section below).</p>

<p>Scripts must be executed in the scope of the <a
href="#browsing1">browsing context</a> of the element's
<code>Document</code>.</p>

<p class=note>The element's attributes' values might have changed between
when the element was inserted into the document and when the script has
finished loading, as may its other attributes; similarly, the element
itself might have been taken back out of the DOM, or had other changes
made. These changes do not in any way affect the above steps; only the
values of the attributes at the time the <code><a
href="#script0">script</a></code> element is first inserted into the
document matter.</p>
</dl>

<p>The DOM attributes <dfn id=src10
title=dom-script-src><code>src</code></dfn>, <dfn id=type12
Expand Down Expand Up @@ -30076,7 +30094,7 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
out, or the user cancels the download, or the parser for manifests fails
when checking the magic signature), or if the resource is labeled with a
MIME type other than <code title="">text/cache-manifest</code>, then run
just to the <span>caching failure steps</span>.</p>
the <a href="#cache0">cache failure steps</a>.</p>

<li>
<p>If this is an <a href="#upgrade"
Expand Down
113 changes: 71 additions & 42 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -20802,46 +20802,75 @@ XXXDVT (also check for '- -' bits in the part above) -->
title="event-load">load</code> event</span>.</p>

<p><dfn title="executing a script block">Executing a script
block</dfn>: If the load resulted in an error (for example a DNS
error, or an HTTP 404 error), then executing the script must just
consist of <span title="fire an error event">firing an <code
title="event-error">error</code> event</span> at the element.</p>

<p>If the load was successful, then first the user agent must
<span>fire a <code title="event-load">load</code> event</span> at
the element, and then, if <span>scripting is enabled</span>, and the
<code>Document</code> does not have <code
title="dom-document-designMode">designMode</code> enabled, and the
<code>Document</code> is the <span>active document</span> in its
<span>browsing context</span>, the user agent must execute the
script:</p>

<p>If the script is from an external file, then that file must be
used as the file to execute.</p>

<p>If the script is inline, then, for scripting languages that
consist of pure text, user agents must use the value of the DOM
<code title="dom-script-text">text</code> attribute (defined below)
as the script to execute, and for XML-based scripting languages,
user agents must use all the child nodes of the <code>script</code>
element as the script to execute.</p>

<p>In any case, the user agent must execute the script according to
the semantics defined by the language associated with <var>the
script's type</var> (see the <a href="#scriptingLanguages">scripting
languages</a> section below).</p>

<p>Scripts must be executed in the scope of the <span>browsing
context</span> of the element's <code>Document</code>.</p>

<p class="note">The element's attributes' values might have changed
between when the element was inserted into the document and when the
script has finished loading, as may its other attributes; similarly,
the element itself might have been taken back out of the DOM, or had
other changes made. These changes do not in any way affect the above
steps; only the values of the attributes at the time the
<code>script</code> element is first inserted into the document
matter.</p>
block</dfn>:</p>

<dl class="switch">

<dt>If the load resulted in an error (for example a DNS error, or
an HTTP 404 error)</dt>

<dd><p>Executing the script must just consist of <span title="fire
an error event">firing an <code title="event-error">error</code>
event</span> at the element.</p></dd>

<dt>If the load was successful</dt>

<dd>

<p>First the user agent must <span>fire a <code
title="event-load">load</code> event</span> at the element, and
then, if <span>scripting is enabled</span>, and the
<code>Document</code> does not have <code
title="dom-document-designMode">designMode</code> enabled, and the
<code>Document</code> is the <span>active document</span> in its
<span>browsing context</span>, the user agent must execute the
script:</p>

<dl class="switch">

<dt>If the script is from an external file</dt>

<dd>

<p>That file must be used as the file to execute.</p>

</dd>

<dt>If the script is inline</dt>

<dd>

<p>For scripting languages that consist of pure text, user
agents must use the value of the DOM <code
title="dom-script-text">text</code> attribute (defined below) as
the script to execute, and for XML-based scripting languages,
user agents must use all the child nodes of the
<code>script</code> element as the script to execute.</p>

</dd>

</dl>

<p>In any case, the user agent must execute the script according to
the semantics defined by the language associated with <var>the
script's type</var> (see the <a href="#scriptingLanguages">scripting
languages</a> section below).</p>

<p>Scripts must be executed in the scope of the <span>browsing
context</span> of the element's <code>Document</code>.</p>

<p class="note">The element's attributes' values might have changed
between when the element was inserted into the document and when the
script has finished loading, as may its other attributes; similarly,
the element itself might have been taken back out of the DOM, or had
other changes made. These changes do not in any way affect the above
steps; only the values of the attributes at the time the
<code>script</code> element is first inserted into the document
matter.</p>

</dd>

</dl>

<p>The DOM attributes <dfn
title="dom-script-src"><code>src</code></dfn>, <dfn
Expand Down Expand Up @@ -27932,8 +27961,8 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
connection times out, or the user cancels the download, or the
parser for manifests fails when checking the magic signature), or
if the resource is labeled with a MIME type other than <code
title="">text/cache-manifest</code>, then run just to the
<span>caching failure steps</span>.</p>
title="">text/cache-manifest</code>, then run the <span>cache
failure steps</span>.</p>

</li>

Expand Down

0 comments on commit 94e1456

Please sign in to comment.