From 0382484c6a56476f26de1ebfd5944575e479aa2a Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 27 Sep 2021 11:39:02 +0300 Subject: [PATCH 1/2] Add non-normative notes for attributes. Each attribute has a "note" explanation of when it is measured, with a link to the service-worker/HTML spec where it's being measured in practice. Also update the diagram to include service-worker handling. Closes #157. --- index.html | 96 ++++++++++++++++++++++++++++++++-------- timestamp-diagram-sw.svg | 1 + 2 files changed, 78 insertions(+), 19 deletions(-) create mode 100644 timestamp-diagram-sw.svg diff --git a/index.html b/index.html index 302da15..d10ca94 100644 --- a/index.html +++ b/index.html @@ -312,6 +312,15 @@

  • If |workerTiming| is null, then return |this|'s prototype's `workerStart`.
  • Return |workerTiming|'s [=service worker timing info/start time=]. +

    + Though `workerStart` is exposed in PerformanceResourceTiming, it + has a different meaning in Navigation Timing, as unlike subresources, a navigation may + trigger the activation or running of a service worker. + In the context of Navigation Timing, `workerStart` returns the timestamp measured + just before the worker has been activated or started. See [[service-workers]] for + a precise definition. +

  • The `fetchStart` getter steps are to perform the following steps:
      @@ -319,6 +328,17 @@

    1. If |workerTiming| is null, then return |this|'s prototype's `fetchStart`.
    2. Return |workerTiming|'s [=service worker timing info/fetch event dispatch time=].
    +

    + When a [=service worker=] is used as part of the navigation, The `fetchStart` overload + holds a different meaning than the meaning in + + PerformanceResourceTiming. + It returns the timestamp measured right before the {{FetchEvent}} is dispatched for + the [=service worker=]. The time difference between `workerStart` and `fetchStart` in + the document's navigation timing entry can be used to determine roughly how long it + took for the worker to be initialized or activated. See [[service-workers]] for + a precise definition. +

  • @@ -379,57 +399,82 @@

    A {{PerformanceNavigationTiming}} has an associated null or [=service worker timing info=] service worker timing. -

    +

    The unloadEventStart getter steps are to return |this|'s - [=previous document unload timing=]'s [=document unload timing info/unload event start time=]. - -

    See unload event for more info.

    - + [=previous document unload timing=]'s [=document unload timing info/unload event start + time=]. +

    If the previous document and the current document have the same + origin, this timestamp is measured immediately + before the user agent starts the unload event + of the previous document. If there is no previous document or the + previous document has a different origin than the current document, this attribute will return + zero. +

    The unloadEventEnd getter steps are to return |this|'s - [=previous document unload timing=]'s [=document unload timing info/unload event end time=]. -

    See unload event for more info.

    - + [=previous document unload timing=]'s + [=document unload timing info/unload event end time=]. +

    If the previous document and the current document have the same + origin, this timestamp is measured immediately + after the user agent handles the unload event + of the previous document. If there is no previous document or the + previous document has a different origin than the current document, this attribute will return + zero. +

    The domInteractive getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/DOM interactive time=].

    -

    See document readiness for more info. +

    This timestamp is measured before the user agent sets the + current document readiness to + "interactive".

    The domContentLoadedEventStart getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/DOM content loaded event start time=].

    -

    See DOMContentLoaded for more info. +

    +

    This timestamp is measured before the user agent dispatches the + DOMContentLoaded + event.

    The domContentLoadedEventEnd getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/DOM content loaded event end time=].

    -

    See DOMContentLoaded - event completes. +

    This timestamp is measured after the user agent completes handling of the + DOMContentLoaded + event.

    The domComplete getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/DOM complete time=]. -

    See document readiness for more info. +

    This timestamp is measured before the user agent sets the + current document readiness to + "complete". See document readiness for a precise + definition.

    The loadEventStart getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/load event start time=].

    +

    This timestamp is measured before the user agent dispatches the + load event for the document. +

    The loadEventEnd getter steps are to return |this|'s [=document load timing=]'s [=document load timing info/load event end time=].

    +

    This timestamp is measured after the user agent completes handling the + load event for the document. +

    The type getter steps are to run the |this|'s [=navigation type=].

    @@ -538,6 +583,19 @@

    Navigation Timing attributes +
    +
    + This figure illustrates the timing attributes defined by the + {{PerformanceNavigationTiming}} interface, when a [=service worker=] is used as part of + the fetch. Attributes in + parenthesis indicate that they may not be available for navigations + involving documents from different origins. +
    + + Navigation Timing attributes with Service Worker +
    diff --git a/timestamp-diagram-sw.svg b/timestamp-diagram-sw.svg new file mode 100644 index 0000000..8ac7d3f --- /dev/null +++ b/timestamp-diagram-sw.svg @@ -0,0 +1 @@ + \ No newline at end of file From f80accfa90208461b5eaff0a121f4ef71dd496ff Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 27 Sep 2021 13:32:43 +0300 Subject: [PATCH 2/2] Separate diagram change, for later PR --- index.html | 13 ------------- timestamp-diagram-sw.svg | 1 - 2 files changed, 14 deletions(-) delete mode 100644 timestamp-diagram-sw.svg diff --git a/index.html b/index.html index d10ca94..b67f3e9 100644 --- a/index.html +++ b/index.html @@ -583,19 +583,6 @@

    Navigation Timing attributes -
    -
    - This figure illustrates the timing attributes defined by the - {{PerformanceNavigationTiming}} interface, when a [=service worker=] is used as part of - the fetch. Attributes in - parenthesis indicate that they may not be available for navigations - involving documents from different origins. -
    - - Navigation Timing attributes with Service Worker -

    diff --git a/timestamp-diagram-sw.svg b/timestamp-diagram-sw.svg deleted file mode 100644 index 8ac7d3f..0000000 --- a/timestamp-diagram-sw.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file