<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22387</bug_id>
          
          <creation_ts>2013-06-16 21:30:58 +0000</creation_ts>
          <short_desc>Fix task model</short_desc>
          <delta_ts>2013-10-23 17:23:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>Fetch</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcos Caceres">w3c</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+fetchspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89371</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-06-16 21:30:58 +0000</bug_when>
    <thetext>http://fetch.spec.whatwg.org/#fetching

[[
If no transmission is taking place, queue at least one task. 
]]

It would be nice if the spec explained why. It&apos;s not clear (to me) what the above actually means.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89633</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-06-20 06:07:46 +0000</bug_when>
    <thetext>This is a part of Fetch that still needs cleaning up and I&apos;m not entirely sure how to best do it.

Basically when you do an async fetch we need to report on updates via network tasks.

Once for all HTTP headers. Once or more for at least one byte or no byte at all and then transmission as it occurs (and not if not). And once for fully transmitted.

That will then correspond to readystatechange events in a rewritten XMLHttpRequest that takes advantage of Fetch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92867</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-03 12:38:50 +0000</bug_when>
    <thetext>This is the way to do this: http://krijnhoetmer.nl/irc-logs/whatwg/20130723#l-734</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94792</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-15 18:27:40 +0000</bug_when>
    <thetext>From that log, &quot;Immediately after receiving the last header for the resource, or immediately before sending the first task to process the resource&apos;s data, if there are no headers, queue a task to &lt;dfn&gt;process the headers&lt;/dfn&gt; of the resource, passing it all the metadata received.&quot; is the critical bit.

Trying to think through the model below. 

In response to a request you get a response in three stages:

  * response headers
  * response data
  * response complete

or you get:

  * network error

or you get:

  * termination

This last one you can also get while getting a response as it&apos;s delivered when the end-user terminated the request or a timeout happened.

So an API using Fetch at a minimum has to deal with &quot;response complete&quot;, &quot;network error&quot;, and &quot;termination&quot;. However, if you want something like &lt;img&gt; to behave as if all data was passed to the image decoder until the end-user terminated the request you have to use &quot;response data&quot; as well, so more commonly you will have to use all five hooks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>