@@ -115,6 +115,7 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
115
115
<pre class=link-defaults>
116
116
spec:dom; type:dfn; text:element
117
117
spec:dom; type:dfn; text:event;
118
+ spec:xhr; type:event; text:progress;
118
119
spec:infra; type:dfn; text:implementation-defined
119
120
</pre>
120
121
@@ -8524,6 +8525,11 @@ callback FetchMonitorCallback = undefined (FetchMonitor monitor);
8524
8525
8525
8526
[Exposed=(Window,Worker)]
8526
8527
interface FetchMonitor : EventTarget {
8528
+ readonly attribute double requestLoaded;
8529
+ readonly attribute double responseLoaded;
8530
+ readonly attribute double requestTotal;
8531
+ readonly attribute double responseTotal;
8532
+
8527
8533
attribute EventHandler onrequestprogress;
8528
8534
attribute EventHandler onresponseprogress;
8529
8535
};
@@ -8607,32 +8613,30 @@ method steps are:
8607
8613
8608
8614
<li><p> Set <var> monitor</var> to a {{FetchMonitor}} .
8609
8615
8616
+ <li><p> Set <var> monitor</var> 's requestTotal to <var>request</var>' s
8617
+ <a for=request>body</a> 's <a for=body>length</a>, if <var>request</var>' s <a for=request>body</a>
8618
+ is non-null; otherwise 0.
8619
+
8610
8620
<li><p> Let <var> args</var> be « <var> monitor</var> ».
8611
8621
8612
8622
<li><p> [=invoke|Invoke=] <var> monitorCallback</var> with <var> args</var>
8613
8623
and <code> "rethrow"</code> . If this throws an exception, <a for=/>reject</a> <var> p</var> with it
8614
8624
and return <var> p</var> .
8615
8625
</ol>
8616
8626
8617
- <li><p> Let <var> requestBodyTransmitted</var> be 0.
8618
-
8619
- <li><p> Let <var> requestBodyLength</var> be <var> request</var> 's <a for=request>body</a>' s
8620
- <a for=body>length</a> , if <var> request</var> 's <a for=request>body</a> is non-null;
8621
- otherwise 0.
8622
-
8623
- <li><p> Assert: <var> requestBodyLength</var> is an integer.
8624
-
8625
8627
<li>
8626
8628
<p> Let <var> processRequestBodyChunkLength</var> , given a <var> bytesLength</var> , be these steps:
8627
8629
8628
8630
<ol>
8629
- <li><p> Increase <var> requestBodyTransmitted</var> by <var> bytesLength</var> .
8631
+ <li><p> If <var> monitor</var> is null, then return.
8632
+
8633
+ <li><p> Increase <var> monitor</var> 's requestLoaded by <var> bytesLength</var> .
8630
8634
8631
8635
<li><p> If not roughly 50ms has passed since these steps were last invoked, then return.
8632
8636
8633
- <li><p> If <var> monitor </var> is not null, then <a>fire a progress event</a> named
8634
- <a event><code>requestprogress</code></a> at <var> monitor</var> with <var> requestBodyTransmitted </var>
8635
- and <var> requestBodyLength </var> .
8637
+ <li><p> <a>Fire a progress event</a> named
8638
+ <a event><code>requestprogress</code></a> at <var> monitor</var> with
8639
+ <var> monitor </var> 's requestLoaded and <var>monitor </var>' s requestTotal .
8636
8640
</ol>
8637
8641
8638
8642
<li>
@@ -8641,8 +8645,9 @@ method steps are:
8641
8645
<ol>
8642
8646
<li><p> If <var> monitor</var> is null, then return.
8643
8647
8644
- <li><p> <a>Fire a progress event</a> named <a event><code>requestprogress</code></a> at <var> monitor</var>
8645
- with <var> requestBodyTransmitted</var> and <var> requestBodyLength</var> .
8648
+ <li><p> <a>Fire a progress event</a> named <a event><code>requestprogress</code></a> at
8649
+ <var> monitor</var> with <var> monitor</var> 's requestLoaded and
8650
+ <var> monitor</var> 's requestTotal.
8646
8651
</ol>
8647
8652
8648
8653
<li>
@@ -9260,6 +9265,12 @@ WHATWG community to ensure input from people familiar with the subject.
9260
9265
<td> Progress has begun.
9261
9266
<td> Once.
9262
9267
<td> First.
9268
+ <tr>
9269
+ <th> <a event><code>progress</code></a>
9270
+ <td> In progress.
9271
+ <td> Once or more.
9272
+ <td> After <code> loadstart</code> has been
9273
+ <a>dispatched</a> .
9263
9274
<tr>
9264
9275
<th> <a event><code>requestprogress</code></a>
9265
9276
<td> In progress request.
0 commit comments