hixie: Provide a sync version of the fetch algorithm, for XHR to reference. (whatwg r4742)

hixie: Provide a sync version of the fetch algorithm, for XHR to
reference. (whatwg r4742)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3788&r2=1.3789&f=h
http://html5.org/tools/web-apps-tracker?from=4741&to=4742

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3788
retrieving revision 1.3789
diff -u -d -r1.3788 -r1.3789
--- Overview.html 15 Feb 2010 00:32:04 -0000 1.3788
+++ Overview.html 15 Feb 2010 01:04:01 -0000 1.3789
@@ -4491,8 +4491,15 @@
 
   <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>
 
@@ -4528,7 +4535,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>
 
@@ -4550,8 +4558,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
@@ -4586,13 +4594,22 @@
 
     </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

Received on Monday, 15 February 2010 01:04:47 UTC