diff --git a/index.html b/index.html index 1411cd8..26bb4a0 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,11 @@ company: "Google", companyURL: "https://google.com/", w3cid: "58673" + }, { + name: "Noam Rosenthal", + mailto: "noam.j.rosenthal@gmail.com", + company: "Invited Expert", + w3cid: "121539" }], formerEditors: [{ name: "Ilya Grigorik", @@ -61,7 +66,7 @@ subjectPrefix: "[ResourceTiming]", github: "https://github.com/w3c/resource-timing/", caniuse: "resource-timing", - xref: ["html", "hr-time-2", "performance-timeline-2"], + xref: ["html", "hr-time-3", "performance-timeline-2", "fetch", "infra"], }; @@ -253,8 +258,7 @@
The rest of this section is non-normative.
Examples:
src
-attribute of two HTML IMG
elements, the fetch of the resource initiated by the
+attribute of two HTML IMG
elements, the [=fetch=] of the resource initiated by the
first HTML IMG
element SHOULD be included as a
PerformanceResourceTiming object in the Performance
@@ -286,8 +289,7 @@ src
attribute of a HTML IMG
-element is changed via script, both the fetch of the original resource as well as
+element is changed via script, both the [=fetch=] of the original resource as well as
the fetch of the new URL
would be included as PerformanceResourceTiming objects in
the Resources Included in the PerformanceResourceTiming
IFRAME
. If at a later time the src
attribute is changed dynamically via script, the user agent may
fetch the new URL resource
-for the IFRAME
. In this case, only the fetch of the new URL would be included as
+for the IFRAME
. In this case, only the [=fetch=] of the new URL would be included as
a PerformanceResourceTiming object in the Performance
Timeline.XMLHttpRequest
cannot reuse the download issued for
the first XMLHttpRequest
.
IFRAME
element is included on the page,
@@ -332,8 +332,7 @@ data: URI
contains
-embedded data and does not require a fetch.The PerformanceResourceTiming interface participates in
-the Performance
-Timeline and extends the following attributes of the
-PerformanceEntry
-interface:
resource
".
- DOMHighResTimeStamp
is defined in [[HR-TIME-2]].
-
[Exposed=(Window,Worker)] interface PerformanceResourceTiming : PerformanceEntry { @@ -411,385 +376,115 @@-The PerformanceResourceTiming Interface
[Default] object toJSON(); };
When toJSON -is called, run [[WEBIDL]]'s default toJSON operation.
-On getting, the
-initiatorType attribute MUST return one of the following
-DOMString
values:
localName
of that
-element
-[[DOM]], if the request is a result of processing the
-element
;url()
directive
-[[CSS-SYNTAX-3]], such as @import url()
or
-background: url()
;On getting, the -attribute nextHopProtocol returns the network protocol -used to fetch the resource, as identified by the ALPN Protocol ID -[[RFC7301]]; resources retrieved from relevant application caches -or local resources, return an empty string. When a proxy is -configured, if a tunnel connection is established then this -attribute MUST return the ALPN Protocol ID of the tunneled -protocol, otherwise it MUST return the ALPN Protocol ID of the -first hop to the proxy. In order to have precisely one way to -represent any ALPN protocol ID, the following additional -constraints apply: octets in the ALPN protocol MUST NOT be -percent-encoded if they are valid token characters except "%", and -when using percent-encoding, uppercase hex digits MUST be used.
-Formally registered ALPN protocol IDs are documented by -IANA. In case the user agent is using an experimental, -non-registered protocol, the user agent MUST use the ALPN -negotiated value if any. If ALPN was not used for protocol -negotiations, the user agent MAY use another descriptive -string.
-The "h3" ALPN ID is defined for the final version -of the HTTP/3 protocol in the HTTP/3 Internet Draft.
-Note that the nextHopProtocol attribute is -intended to identify the network protocol in use for the fetch -regardless of how it was actually negotiated; that is, even if ALPN -is not used to negotiate the network protocol, this attribute still -uses the ALPN Protocol ID's to indicate the protocol in use.
-On getting, the -workerStart attribute MUST return as follows:
-If the active -service worker of the context object's -relevant settings object is not -null and if the resource passes the timing allow check algorithm or the -resource Request's destination does not equal -"document":
-Note that according to the definition of time origin in workers, it is -possible that some attributes of -navigation preload requests will have negative {{DOMHighResTimeStamp}} -values.
-On getting, the -redirectStart attribute MUST return as follows:
-On getting, the -redirectEnd attribute MUST return as follows:
-On getting, the -fetchStart attribute MUST return as follows:
-On getting, the -domainLookupStart attribute MUST return as follows:
-On getting, the -domainLookupEnd attribute MUST return as follows:
-On getting, the -connectStart attribute MUST return as follows:
-If the transport connection fails and the user agent reopens a -connection, connectStart SHOULD return the -corresponding value of the new connection.
-On getting, the -connectEnd attribute MUST return as follows:
-A PerformanceResourceTiming has an associated +DOMString initiator type. +
A PerformanceResourceTiming has an associated DOMString +requested URL. -
Example: Suppose the user agent establishes an HTTP/2 connection
-over TLS 1.3 to send a GET request and a POST request. It sends the ClientHello
-at time t1
and then sends the GET request with early data. The
-POST request is not safe [[RFC7231]] (section 4.2.1), so the user agent waits
-to complete the handshake at time t2
before sending it. Although
-both requests used the same connection, the GET request reports a connectEnd
-value of t1
, while the POST request reports a connectEnd value for
-t2
.
A PerformanceResourceTiming has an associated +[=fetch timing info=] timing info. -
If the transport connection fails and the user agent reopens a -connection, connectEnd SHOULD return the -corresponding value of the new connection.
-On getting, the -secureConnectionStart attribute MUST return as -follows:
-On getting, the -requestStart attribute MUST return as follows:
-If the transport connection fails after a request is sent and -the user agent reopens a connection and resend the request, -requestStart MUST -return the corresponding values of the new request.
-On getting, the -responseStart attribute MUST return as follows:
-On getting, the -responseEnd attribute MUST return the result of running -the algorithm to get response end time.
+The PerformanceResourceTiming interface participates in
+the Performance
+Timeline and extends the following attributes of the
+PerformanceEntry
+interface:
resource
".The startTime getter +steps are to convert fetch timestamp for this's +timing info's +[=fetch timing info/start time=] and this's +relevant global object. +
The duration getter steps are to return +this's timing info's +[=fetch timing info/end time=] minus this's timing +info's [=fetch timing info/start time=]. +
When requested to run the get response end time -algorithm, the user agent must run the following steps:
-On getting, the -transferSize attribute MUST return as follows:
-If there are HTTP redirects or equivalent when -navigating and if all the redirects or equivalent are same origin, this attribute SHOULD -include the HTTP overhead of incurred redirects.
-This attribute SHOULD include HTTP overhead (such as HTTP/1.1 -chunked encoding and whitespace around header fields, including -newlines, and HTTP/2 -frame overhead, along with other server-to-client frames on the -same stream), but SHOULD NOT include lower-layer protocol overhead -(such as TLS [[RFC5246]]or TCP).
- -On getting, the -encodedBodySize attribute MUST return as follows:
-On getting, the -decodedBodySize attribute MUST return as follows:
-When toJSON +is called, run [[WEBIDL]]'s default toJSON operation.
++initiatorType getter steps are to return the +initiator type for this. +
The workerStart getter +steps are to convert fetch timestamp for this's +timing info's +[=fetch timing info/final service worker start time=] and the relevant global object for +this. See [=/HTTP fetch=] for more info. +
The redirectStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/redirect start time=] and the relevant global object +for this. See [=/HTTP-redirect fetch=] for more info. +
The redirectEnd getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/redirect end time=] and the relevant global object for +this. See [=/HTTP-redirect fetch=] for more info. +
The fetchStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/post-redirect start time=] and the relevant global object +for this. See [=/HTTP fetch=] for more info. +
The domainLookupStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final connection timing info=]'s +[=connection timing info/domain lookup start time=] and the relevant global object for +this. +See Recording connection timing +info for more info. +
The domainLookupEnd getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final connection timing info=]'s +[=connection timing info/domain lookup end time=] and the relevant global object for +this. See Recording +connection timing info for more info. +
The connectStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final connection timing info=]'s +[=connection timing info/connection start time=] and the relevant global object for +this. See Recording connection +timing info for more info. +
The connectEnd getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final connection timing info=]'s +[=connection timing info/connection end time=] and the relevant global object for this. +See Recording connection +timing info for more info. +
The secureConnectionStart getter steps are +to convert fetch timestamp for this's timing +info's [=fetch timing info/final connection timing info=]'s +[=connection timing info/secure connection start time=] and the relevant global object for +this. See Recording +connection timing info for more info. +
The nextHopProtocol getter steps are to +[=/isomorphic decode=] this's timing info's +[=fetch timing info/final connection timing info=]'s +[=connection timing info/ALPN negotiated protocol=]. See +Recording connection timing info +for more info. +
The requestStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final network-request start time=] and the relevant global +object for this. See [=/HTTP fetch=] for more info. +
The responseStart getter steps are to +convert fetch timestamp for this's timing +info's [=fetch timing info/final network-response start time=] and the +relevant global object for this. See [=/HTTP fetch=] for more info. +
The responseEnd getter +steps are to convert fetch timestamp for this's +timing info's +[=fetch timing info/end time=] and the relevant global object for this. +See [=/fetch=] for more info.
A user agent implementing PerformanceResourceTiming would
need to include "resource"
in Extensions to the Performance
Interface
Cross-origin resources -MUST be included as PerformanceResourceTiming objects in the -Performance -Timeline. If the timing allow check algorithm fails for -a resource, these attributes of its PerformanceResourceTiming -object MUST be set to zero: -redirectStart, redirectEnd, domainLookupStart, -domainLookupEnd, connectStart, connectEnd, -requestStart, responseStart, -secureConnectionStart, transferSize, -encodedBodySize and decodedBodySize.
-Server-side applications may return the -Timing-Allow-Origin HTTP response header to allow the User -Agent to fully expose, to the document origin(s) specified, the -values of attributes that would have been zero due to the -cross-origin restrictions previously specified in this -section.
-Timing-Allow-Origin
Response HeaderThe Timing-Allow-Origin HTTP response header field -can be used to communicate a policy indicating origin(s) that are -allowed to see values of attributes that would have been zero due -to the cross-origin restrictions. The header's value is represented -by the following ABNF [[RFC5234]] (using List Extension, [[RFC7230]]):
-- Timing-Allow-Origin = 1#( origin-or-null / wildcard ) --
The sender MAY generate multiple Timing-Allow-Origin -header fields. The recipient MAY combine multiple -Timing-Allow-Origin header fields by appending each -subsequent field value to the combined field value in order, -separated by a comma.
-The timing allow check algorithm, which checks -whether a resource's timing information can be shared with the -current document, is as follows:
-The Timing-Allow-Origin header may arrive as part of a cached -response. In case of cache revalidation, according to -RFC 7234, -the header's value may come from the revalidation response, or if not present -there, from the original cached resource.
+As detailed in [=Fetch=], + cross-origin resources are included as PerformanceResourceTiming objects in the + Performance + Timeline. If the timing allow check algorithm + fails for a resource, the following attributes of its PerformanceResourceTiming + object are set to zero: +{{PerformanceResourceTiming/redirectStart}}, {{PerformanceResourceTiming/redirectEnd}}, +{{PerformanceResourceTiming/domainLookupStart}}, {{PerformanceResourceTiming/domainLookupEnd}}, +{{PerformanceResourceTiming/connectStart}}, {{PerformanceResourceTiming/connectEnd}}, +{{PerformanceResourceTiming/requestStart}}, {{PerformanceResourceTiming/responseStart}}, +{{PerformanceResourceTiming/secureConnectionStart}}, {{PerformanceResourceTiming/transferSize}}, +{{PerformanceResourceTiming/encodedBodySize}}, and {{PerformanceResourceTiming/decodedBodySize}}.
+Server-side applications may return the + Timing-Allow-Origin + HTTP response header to allow the User + Agent to fully expose, to the document origin(s) specified, the + values of attributes that would have been zero due to the + cross-origin restrictions previously specified in this + section.
+Timing-Allow-Origin
Response HeaderThe Timing-Allow-Origin HTTP response header field + can be used to communicate a policy indicating origin(s) that are + allowed to see values of attributes that would have been zero due + to the cross-origin restrictions. The header's value is represented + by the following ABNF [[RFC5234]] (using List Extension, [[RFC7230]]):
++ Timing-Allow-Origin = 1#( origin-or-null / wildcard ) ++
The sender MAY generate multiple Timing-Allow-Origin + header fields. The recipient MAY combine multiple + Timing-Allow-Origin header fields by appending each + subsequent field value to the combined field value in order, + separated by a comma.
+The Timing-Allow-Origin headers are processed in + FETCH to compute the attributes accordingly. +
The Timing-Allow-Origin header may arrive as part of a cached + response. In case of cache revalidation, according to + RFC 7234, + the header's value may come from the revalidation response, or if not present + there, from the original cached resource.
This section is non-normative.
The following graph illustrates the timing attributes defined by -the PerformanceResourceTiming interface. Attributes in parenthesis -may not be available when fetching cross-origin resources. User agents may -perform internal processing in between timings, which allow for non-normative -intervals between timings.
-For each resource whose Request has a non-null client, perform -the following steps:
-no-cors
policy,
-abort the remaining steps.
-Above cross-origin exclusion should be defined via -Fetch registry: CSS needs to be defined in terms of Fetch and set -some kind of "opaque request flag" for no-CORS CSS subresources. In -turn, Resource Timing should interface with Fetch registry to -surface resource fetch events.
-The above resource exclusion is at risk as currently only one -implementation passes the related test.
-resource
.Network protocols may not perform the connection -establishment, secure connection establishment and request sending in a -sequential manner. Therefore, developers should not expect these values -to always be in a particular order.
-To mark resource timing given a +[=/fetch timing info=] |timingInfo|, a DOMString +|requestedURL|, a DOMString |initiatorType| and a global object |global|:
This specification does not specify whether steps
-20 and 21 should run before or after the load
event of
-the resource—see issue 82 for
-related discussion.
The value of the timing attributes MUST monotonically increase -to ensure timing attributes are not skewed by adjustments to the -system clock while fetching the resource. The difference between any two -chronologically recorded timing attributes MUST never be negative. -For all resources, including subdocument resources, the user agent -MUST record the system clock at the beginning of the root document -navigation and define subsequent timing attributes in terms of a -monotonic clock measuring time elapsed from the beginning of the -navigation.
-To convert fetch timestamp given {{DOMHighResTimeStamp}} |ts| and +global object |global|, do the following: +