<?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>22228</bug_id>
          
          <creation_ts>2013-05-31 11:40:45 +0000</creation_ts>
          <short_desc>Clarification of timeout attribute late overrides</short_desc>
          <delta_ts>2014-10-15 17:14:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>XHR</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>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dominik Röttsches (drott)">dominik.rottsches</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bugs</cc>
    
    <cc>caitpotter88</cc>
    
    <cc>glenn</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-webapps</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88508</commentid>
    <comment_count>0</comment_count>
    <who name="Dominik Röttsches (drott)">dominik.rottsches</who>
    <bug_when>2013-05-31 11:40:45 +0000</bug_when>
    <thetext>Section 4.6.3. - &quot;the timeout attribute&quot; non-normatively explains 
&quot;Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed.&quot;

Later sections
&quot;4.6.7 Infrastructure for the send() method&quot; normatively specify:

&quot;If timeout is not 0 and since the request started the amount of milliseconds specified by timeout has passed&quot;

This implicitly does not rule out the situation where a timeout is set for an XHR first, then send() is called on it, and then the timeout attribute is updated to a new value, either shorter, or longer. A shorter value leading to an earlier timeout, a longer value giving the request more time to complete. Let&apos;s call this situation a &quot;late timeout override&quot;.

I would like to see clarification on whether the spec authors expect the UA to support such late overrides or whether a late timeout attribute override should have no effect.

My experience from trying to implement this on Blink shows that it would lead to layering violations in the loading code. After the request is sent out, Blink currently has no means of updating loader parameters to update the timeout and hence updating the timeout timer to for example fire and abort the request earlier.

While it&apos;s feasible to refactor Blink to allow this, I would like to raise the question whether the late timeout override behavior is desirable and intended. Similar semantics are achieved with aborting the request, reconfiguring a new timeout value, sending it out again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88510</commentid>
    <comment_count>1</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-05-31 11:54:31 +0000</bug_when>
    <thetext>The late timeout override is intended. It is useful if some data
has been loaded and one wants to try to finish the load.
FYI, in Gecko all the XHR timeout handling happens outside/above the network library.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88515</commentid>
    <comment_count>2</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-05-31 13:24:18 +0000</bug_when>
    <thetext>See the note at http://xhr.spec.whatwg.org/#dom-xmlhttprequest-timeout: &quot;This implies that the timeout attribute can be set while fetching is in progress. If that occurs it will still be measured relative to the start of fetching.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93116</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-06 15:54:24 +0000</bug_when>
    <thetext>Seems clear enough, especially with the note.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107858</commentid>
    <comment_count>4</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2014-06-16 13:46:39 +0000</bug_when>
    <thetext>This confused #servo too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113218</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-10-15 17:14:21 +0000</bug_when>
    <thetext>https://github.com/whatwg/xhr/commit/2677cc2e0fe79d290437c3ea9ff370a5d795294b

Sorry for taking so long in fixing this regression.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>