Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delivery type to PerformanceResourceTiming. #343

Merged
merged 4 commits into from Mar 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 46 additions & 5 deletions index.html
Expand Up @@ -355,6 +355,7 @@ <h3>
[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
readonly attribute DOMString deliveryType;
readonly attribute ByteString nextHopProtocol;
readonly attribute DOMHighResTimeStamp workerStart;
readonly attribute DOMHighResTimeStamp redirectStart;
Expand All @@ -381,6 +382,11 @@ <h3>
<a data-dfn-for="PerformanceResourceTiming"><dfn>initiator
type</dfn></a>.
</p>
<p>
A <a>PerformanceResourceTiming</a> has an associated DOMString
<a data-dfn-for="PerformanceResourceTiming"><dfn>delivery
type</dfn></a>.
</p>
<p>
A <a>PerformanceResourceTiming</a> has an associated DOMString
<a data-dfn-for="PerformanceResourceTiming"><dfn>requested
Expand Down Expand Up @@ -552,6 +558,32 @@ <h3>
The setting of `initiatorType` is done at the different places where
a resource timing entry is reported, such as the [=fetch=] standard.
</p>
<p data-dfn-for="PerformanceResourceTiming">
<dfn>deliveryType</dfn> getter steps are to return the <a data-for=
"PerformanceResourceTiming">delivery type</a> for <a>this</a>.
</p>
<div class='note'>
<p>
`deliveryType` returns one of the following values:
</p>
<ul>
<li>
<code>"cache"</code>, if the <a data-for=
"PerformanceResourceTiming">cache mode</a> is not the empty
string.
</li>
<li>
the empty string <code>""</code>, if none of the above conditions
match.
</li>
</ul>

<p>
This is expected to be expanded by future updates to this
specification, e.g. to describe consuming preloaded resources and
prefetched navigation requests.
</p>
</div>
<p data-dfn-for="PerformanceResourceTiming">
The <dfn>workerStart</dfn> getter steps are to <a>convert fetch
timestamp</a> for <a>this</a>'s <a data-for=
Expand Down Expand Up @@ -1030,7 +1062,8 @@ <h4>
<p>
The user agent MAY still enforce cross-origin restrictions and set
transferSize, encodedBodySize, and decodedBodySize attributes to
zero, even with Timing-Allow-Origin HTTP response header fields.
zero, even with Timing-Allow-Origin HTTP response header fields. If
it does, it MAY also set deliveryType to "".
</p>
<p>
The <a>Timing-Allow-Origin</a> headers are processed in
Expand Down Expand Up @@ -1130,8 +1163,9 @@ <h2>
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|, a string
|cacheMode|, a [=/response body info=] |bodyInfo|, and a
|cacheMode|, a [=/response body info=] |bodyInfo|, a
<a data-cite="FETCH#concept-status">status</a> |responseStatus|,
and an optional [=string=] |deliveryType| (by default, the empty string),
perform the following steps:
</p>
<ol>
Expand All @@ -1141,7 +1175,7 @@ <h2>
<li>
<a>Setup the resource timing entry</a> for |entry|, given
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|,
|bodyInfo| and |responseStatus|.
|bodyInfo|, |responseStatus|, and |deliveryType|.
</li>
<li>
<a data-cite=
Expand All @@ -1159,8 +1193,9 @@ <h2>
<a>PerformanceResourceTiming</a> |entry| given DOMString
|initiatorType|, DOMString |requestedURL|, [=/fetch timing info=]
|timingInfo|, a DOMString |cacheMode|, a [=response body info=]
|bodyInfo|, and a <a data-cite="FETCH#concept-status">status</a>
|responseStatus|, perform the following steps:
|bodyInfo|, a <a data-cite="FETCH#concept-status">status</a>
|responseStatus|, and an optional DOMString |deliveryType| (by
default, the empty string), perform the following steps:
</p>
<ol>
<li>Assert that |cacheMode| is the empty string,
Expand All @@ -1184,6 +1219,12 @@ <h2>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">response
status</a> to |responseStatus|.
</li>
<li>If |deliveryType| is the empty string and |cacheMode| is not,
then set |deliveryType| to "<code>cache</code>".
</li>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">delivery
type</a> to |deliveryType|.
</li>
</ol>
<p>
To <dfn>convert fetch timestamp</dfn> given {{DOMHighResTimeStamp}}
Expand Down