Skip to content

Commit

Permalink
Use response body info instead of timing info for body sizes (#321)
Browse files Browse the repository at this point in the history
* Use `resource info` instead of `timing info` for body sizes

Those numbers are per-response and not per-fetch, so they need to be
treated separately.

* Rename to resource body info

* Rename to resource body info

* Adjust to fetch rename

* Fix typo
  • Loading branch information
noamr authored Jun 17, 2022
1 parent 148c98c commit d1f319e
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ <h3>
info=] <a data-dfn-for="PerformanceResourceTiming"><dfn>timing
info</dfn></a>.
</p>
<p>
A <a>PerformanceResourceTiming</a> has an associated [=response body
info=] <a data-dfn-for="PerformanceResourceTiming"><dfn>resource
info</dfn></a>.
</p>
<p>
The <a>PerformanceResourceTiming</a> interface participates in the
<a data-cite=
Expand Down Expand Up @@ -653,13 +658,13 @@ <h3>
</p>
<p data-dfn-for="PerformanceResourceTiming">
The <dfn>encodedBodySize</dfn> getter steps are to return
<a>this</a>'s <a data-for="PerformanceResourceTiming">timing
info</a>'s [=fetch timing info/encoded body size=].
<a>this</a>'s <a data-for="PerformanceResourceTiming">resource
info</a>'s [=response body info/encoded size=].
</p>
<p data-dfn-for="PerformanceResourceTiming">
The <dfn>decodedBodySize</dfn> getter steps are to return
<a>this</a>'s <a data-for="PerformanceResourceTiming">timing
info</a>'s [=fetch timing info/decoded body size=].
<a>this</a>'s <a data-for="PerformanceResourceTiming">resource
info</a>'s [=response body info/decoded size=].
</p>
<p data-dfn-for="PerformanceResourceTiming">
The <dfn>transferSize</dfn> getter steps are to perform the following
Expand All @@ -681,8 +686,8 @@ <h3>
<li>
<p>
Return <a>this</a>'s <a data-for=
"PerformanceResourceTiming">timing info</a>'s [=fetch timing
info/encoded body size=] plus 300.
"PerformanceResourceTiming">response body info</a>'s [=response body
info/encoded size=] plus 300.
</p>
<p class='note'>
The constant number added to `transferSize` replaces exposing the
Expand Down Expand Up @@ -1056,16 +1061,16 @@ <h2>
<p>
To <dfn data-export="">mark resource timing</dfn> given a [=/fetch
timing info=] |timingInfo|, a DOMString |requestedURL|, a DOMString
|initiatorType| a <a>global object</a> |global|, and a string
|cacheMode|, perform the following steps:
|initiatorType| a <a>global object</a> |global|, a string
|cacheMode|, and a [=/response body info=] |bodyInfo|, perform the following steps:
</p>
<ol>
<li>Create a <a>PerformanceResourceTiming</a> object |entry| in
|global|'s [=global object/realm=].
</li>
<li>
<a>Setup the resource timing entry</a> for |entry|, given
|initiatorType|, |requestedURL|, |timingInfo|, and |cacheMode|.
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|, and |bodyInfo|.
</li>
<li>
<a data-cite=
Expand All @@ -1082,8 +1087,8 @@ <h2>
To <dfn data-export="">setup the resource timing entry</dfn> for
<a>PerformanceResourceTiming</a> |entry| given DOMString
|initiatorType|, DOMString |requestedURL|, [=/fetch timing info=]
|timingInfo|, and a DOMString |cacheMode|, perform the following
steps:
|timingInfo|, a DOMString |cacheMode|, and a [=response body info=] |bodyInfo|,
perform the following steps:
</p>
<ol>
<li>Assert that |cacheMode| is the empty string or
Expand All @@ -1097,6 +1102,8 @@ <h2>
</li>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">timing
info</a> to |timingInfo|.
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">response body info</a>
to |bodyInfo|.
</li>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">cache
mode</a> to |cacheMode|.
Expand Down

0 comments on commit d1f319e

Please sign in to comment.