[html5] r4742 - [] (0) Provide a sync version of the fetch algorithm, for XHR to reference.
whatwg at whatwg.org
whatwg at whatwg.org
Sun Feb 14 17:03:58 PST 2010
Author: ianh
Date: 2010-02-14 17:03:56 -0800 (Sun, 14 Feb 2010)
New Revision: 4742
Modified:
complete.html
index
source
Log:
[] (0) Provide a sync version of the fetch algorithm, for XHR to reference.
Modified: complete.html
===================================================================
--- complete.html 2010-02-15 00:31:58 UTC (rev 4741)
+++ complete.html 2010-02-15 01:03:56 UTC (rev 4742)
@@ -5201,9 +5201,16 @@
<p>When a user agent is to <dfn id=fetch>fetch</dfn> a resource or
<a href=#url>URL</a>, optionally from an origin <i title="">origin</i>,
- the following steps must be run. (When a <em>URL</em> is to be
- fetched, the URL identifies a resource to be obtained.)</p>
+ and optionally with a <i>synchronous flag</i>, the following steps
+ must be run. (When a <em>URL</em> is to be fetched, the URL
+ identifies a resource to be obtained.)</p>
+ <!-- if invoked with the synchronous flag, make sure to release the
+ storage mutex first -->
+
+ <!-- synchronous flag is only used by sync-XHR, for legacy reasons;
+ don't use it in new features! -->
+
<ol><li>
<p>Generate the <i>address of the resource from which Request-URIs
@@ -5238,7 +5245,8 @@
</li>
- <li><p>Perform the remaining steps asynchronously.</li>
+ <li><p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>, perform the remaining steps asynchronously.</li>
<li>
@@ -5260,8 +5268,8 @@
URLs</span></a>, etc).</p>
<p class=note>The HTTP specification requires that 301, 302, and
- 307 redirects, when applied to methods other than GET or HEAD, not
- be followed without user confirmation.</p>
+ 307 redirects, when applied to methods other than the safe
+ methods, not be followed without user confirmation. <a href=#refsHTTP>[HTTP]</a></p>
<p>For the purposes of the <code title=http-referer>Referer</code> (sic) header, use the
<i>address of the resource from which Request-URIs are
@@ -5296,14 +5304,23 @@
</ol></li>
- <li><p>When the resource is available, or if there is an error of
- some description, <a href=#queue-a-task>queue a task</a> that uses the resource
- as appropriate. If the resource can be processed incrementally, as,
- for instance, with a progressively interlaced JPEG or an HTML file,
- additional tasks may be queued to process the data as it is
- downloaded. The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#networking-task-source>networking task
- source</a>.</p>
+ <li>
+ <p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>: When the resource is available, or if there is an error
+ of some description, <a href=#queue-a-task>queue a task</a> that uses the
+ resource as appropriate. If the resource can be processed
+ incrementally, as, for instance, with a progressively interlaced
+ JPEG or an HTML file, additional tasks may be queued to process
+ the data as it is downloaded. The <a href=#task-source>task source</a> for
+ these <a href=#concept-task title=concept-task>tasks</a> is the
+ <a href=#networking-task-source>networking task source</a>.</p>
+
+ <p>Otherwise, return the resource or error information to the
+ calling algorithm.</p>
+
+ </li>
+
</ol><p>If the user agent can determine the actual length of the resource
being <a href=#fetch title=fetch>fetched</a> for an instance of this
algorithm, and if that length is finite, then that length is the
Modified: index
===================================================================
--- index 2010-02-15 00:31:58 UTC (rev 4741)
+++ index 2010-02-15 01:03:56 UTC (rev 4742)
@@ -5100,9 +5100,16 @@
<p>When a user agent is to <dfn id=fetch>fetch</dfn> a resource or
<a href=#url>URL</a>, optionally from an origin <i title="">origin</i>,
- the following steps must be run. (When a <em>URL</em> is to be
- fetched, the URL identifies a resource to be obtained.)</p>
+ and optionally with a <i>synchronous flag</i>, the following steps
+ must be run. (When a <em>URL</em> is to be fetched, the URL
+ identifies a resource to be obtained.)</p>
+ <!-- if invoked with the synchronous flag, make sure to release the
+ storage mutex first -->
+
+ <!-- synchronous flag is only used by sync-XHR, for legacy reasons;
+ don't use it in new features! -->
+
<ol><li>
<p>Generate the <i>address of the resource from which Request-URIs
@@ -5137,7 +5144,8 @@
</li>
- <li><p>Perform the remaining steps asynchronously.</li>
+ <li><p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>, perform the remaining steps asynchronously.</li>
<li>
@@ -5159,8 +5167,8 @@
URLs</span></a>, etc).</p>
<p class=note>The HTTP specification requires that 301, 302, and
- 307 redirects, when applied to methods other than GET or HEAD, not
- be followed without user confirmation.</p>
+ 307 redirects, when applied to methods other than the safe
+ methods, not be followed without user confirmation. <a href=#refsHTTP>[HTTP]</a></p>
<p>For the purposes of the <code title=http-referer>Referer</code> (sic) header, use the
<i>address of the resource from which Request-URIs are
@@ -5195,14 +5203,23 @@
</ol></li>
- <li><p>When the resource is available, or if there is an error of
- some description, <a href=#queue-a-task>queue a task</a> that uses the resource
- as appropriate. If the resource can be processed incrementally, as,
- for instance, with a progressively interlaced JPEG or an HTML file,
- additional tasks may be queued to process the data as it is
- downloaded. The <a href=#task-source>task source</a> for these <a href=#concept-task title=concept-task>tasks</a> is the <a href=#networking-task-source>networking task
- source</a>.</p>
+ <li>
+ <p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>: When the resource is available, or if there is an error
+ of some description, <a href=#queue-a-task>queue a task</a> that uses the
+ resource as appropriate. If the resource can be processed
+ incrementally, as, for instance, with a progressively interlaced
+ JPEG or an HTML file, additional tasks may be queued to process
+ the data as it is downloaded. The <a href=#task-source>task source</a> for
+ these <a href=#concept-task title=concept-task>tasks</a> is the
+ <a href=#networking-task-source>networking task source</a>.</p>
+
+ <p>Otherwise, return the resource or error information to the
+ calling algorithm.</p>
+
+ </li>
+
</ol><p>If the user agent can determine the actual length of the resource
being <a href=#fetch title=fetch>fetched</a> for an instance of this
algorithm, and if that length is finite, then that length is the
Modified: source
===================================================================
--- source 2010-02-15 00:31:58 UTC (rev 4741)
+++ source 2010-02-15 01:03:56 UTC (rev 4742)
@@ -4716,9 +4716,16 @@
<p>When a user agent is to <dfn>fetch</dfn> a resource or
<span>URL</span>, optionally from an origin <i title="">origin</i>,
- the following steps must be run. (When a <em>URL</em> is to be
- fetched, the URL identifies a resource to be obtained.)</p>
+ and optionally with a <i>synchronous flag</i>, the following steps
+ must be run. (When a <em>URL</em> is to be fetched, the URL
+ identifies a resource to be obtained.)</p>
+ <!-- if invoked with the synchronous flag, make sure to release the
+ storage mutex first -->
+
+ <!-- synchronous flag is only used by sync-XHR, for legacy reasons;
+ don't use it in new features! -->
+
<ol>
<li>
@@ -4761,7 +4768,8 @@
</li>
- <li><p>Perform the remaining steps asynchronously.</p></li>
+ <li><p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>, perform the remaining steps asynchronously.</p></li>
<li>
@@ -4786,8 +4794,9 @@
URLs</span></span>, etc).</p>
<p class="note">The HTTP specification requires that 301, 302, and
- 307 redirects, when applied to methods other than GET or HEAD, not
- be followed without user confirmation.</p>
+ 307 redirects, when applied to methods other than the safe
+ methods, not be followed without user confirmation. <a
+ href="#refsHTTP">[HTTP]</a></p>
<p>For the purposes of the <code
title="http-referer">Referer</code> (sic) header, use the
@@ -4832,15 +4841,23 @@
</li>
- <li><p>When the resource is available, or if there is an error of
- some description, <span>queue a task</span> that uses the resource
- as appropriate. If the resource can be processed incrementally, as,
- for instance, with a progressively interlaced JPEG or an HTML file,
- additional tasks may be queued to process the data as it is
- downloaded. The <span>task source</span> for these <span
- title="concept-task">tasks</span> is the <span>networking task
- source</span>.</p>
+ <li>
+ <p>If the algorithm was not invoked with the <i>synchronous
+ flag</i>: When the resource is available, or if there is an error
+ of some description, <span>queue a task</span> that uses the
+ resource as appropriate. If the resource can be processed
+ incrementally, as, for instance, with a progressively interlaced
+ JPEG or an HTML file, additional tasks may be queued to process
+ the data as it is downloaded. The <span>task source</span> for
+ these <span title="concept-task">tasks</span> is the
+ <span>networking task source</span>.</p>
+
+ <p>Otherwise, return the resource or error information to the
+ calling algorithm.</p>
+
+ </li>
+
</ol>
<p>If the user agent can determine the actual length of the resource
More information about the Commit-Watchers
mailing list