Skip to content

Commit 606cf02

Browse files
noamrmarcoscaceres
andauthored
Integrate with service worker timing (#143)
* Service worker timing * Fix reference * nit * Update index.html Co-authored-by: Marcos Cáceres <[email protected]> * Use cite for superclass * Update index.html Co-authored-by: Marcos Cáceres <[email protected]> * Update index.html Co-authored-by: Marcos Cáceres <[email protected]> * Update index.html Co-authored-by: Marcos Cáceres <[email protected]> * Update index.html Co-authored-by: Marcos Cáceres <[email protected]> * Use 'prototype' as prose for superclass Co-authored-by: Marcos Cáceres <[email protected]>
1 parent ab8c184 commit 606cf02

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

index.html

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -305,23 +305,20 @@ <h3>
305305
"RESOURCE-TIMING-2#dom-performanceresourcetiming">PerformanceResourceTiming</dfn></code>
306306
interface:
307307
</p>
308-
<ul data-dfn-for="PerformanceResourceTiming">
309-
<li>The <dfn>initiatorType</dfn> attribute MUST return the
310-
{{DOMString}} "<code>navigation</code>".
308+
<ul>
309+
<li>The `workerStart` getter steps are to perform the following steps:
310+
<ol>
311+
<li>Let |workerTiming| be |this|'s [=PerformanceNavigationTiming/service worker timing=].
312+
<li>If |workerTiming| is null, then return |this|'s prototype's `workerStart`.
313+
<li>Return |workerTiming|'s [=service worker timing info/start time=].
314+
</ol>
311315
</li>
312-
<li>The <dfn id='dom-PerformanceNavigationTiming-workerStart'><code>
313-
workerStart</code></dfn> attribute MUST return the time immediately
314-
before the user agent <a data-cite=
315-
"service-workers#run-service-worker">ran the worker</a> (if the
316-
<a>current document</a> has an <a data-cite=
317-
"service-workers#dfn-containing-service-worker-registration">active
318-
service worker registration</a> [[SERVICE-WORKERS]]) required to
319-
service the request, or if the worker was already available, the
320-
time immediately before the user agent <a data-cite=
321-
"service-workers#fetchevent">fired an event named `fetch`</a> at
322-
the <a data-cite="service-workers#dfn-active-worker">active
323-
worker</a>. Otherwise, if there is no active worker this attribute
324-
MUST return zero.
316+
<li>The `fetchStart` getter steps are to perform the following steps:
317+
<ol>
318+
<li>Let |workerTiming| be |this|'s [=PerformanceNavigationTiming/service worker timing=].
319+
<li>If |workerTiming| is null, then return |this|'s prototype's `fetchStart`.
320+
<li>Return |workerTiming|'s [=service worker timing info/fetch event dispatch time=].
321+
</ol>
325322
</li>
326323
</ul>
327324
<p class="note">
@@ -370,7 +367,6 @@ <h3>
370367
[=document load timing info=] <a data-dfn-for="PerformanceResourceTiming">
371368
<dfn>document load timing</dfn></a>.
372369

373-
374370
<p>A <a>PerformanceNavigationTiming</a> has an associated
375371
[=document unload timing info=] <a data-dfn-for="PerformanceNavigationTiming">
376372
<dfn>previous document unload timing</dfn></a>.
@@ -381,6 +377,9 @@ <h3>
381377
<p>A <a>PerformanceNavigationTiming</a> has an associated
382378
{{NavigationType}} <a data-dfn-for="PerformanceNavigationTiming"><dfn>navigation type</dfn></a>.
383379

380+
<p>A {{PerformanceNavigationTiming}} has an associated null or [=service worker timing info=]
381+
<dfn data-dfn-for="PerformanceNavigationTiming">service worker timing</dfn>.
382+
384383
</p>
385384
<p data-dfn-for='PerformanceNavigationTiming'>
386385
The <dfn>unloadEventStart</dfn> getter steps are to return |this|'s
@@ -546,14 +545,15 @@ <h2>Creating a navigation timing entry</h2>
546545
<p data-dfn-for="Document">Each [=document=] has an associated <dfn>navigation timing entry</dfn>, initially unset.
547546

548547
<p>To <dfn export="">create the navigation timing entry</dfn> for {{Document}} |document|,
549-
given a [=fetch timing info=] |fetchTiming|, a number |redirectCount|, and a
550-
{{NavigationType}} |navigationType|, do the following:
548+
given a [=fetch timing info=] |fetchTiming|, a number |redirectCount|, a
549+
{{NavigationType}} |navigationType|, and a null or [=service worker timing info=] |serviceWorkerTiming|,
550+
do the following:
551551
<ol>
552552
<li>Let |global| be |document|'s [=relevant global object=].</li>
553553
<li>Let |navigationTimingEntry| be a new {{PerformanceNavigationTiming}} object in |global|'s
554554
[=global object/realm=].
555555
<li><a data-cite="RESOURCE-TIMING-2#dfn-setup-the-resource-timing-entry">Setup the resource
556-
timing entry=] for |navigationTimingEntry| given "<code>navigation</code>", |document|'s
556+
timing entry</a> for |navigationTimingEntry| given "<code>navigation</code>", |document|'s
557557
<a data-cite="HTML#the-document's-address">address</a>, and |fetchTiming|.
558558
<li>Set |navigationTimingEntry|'s <a data-for="PerformanceNavigationTiming">document load
559559
timing</a> to |document|'s [=Document/load timing info=]
@@ -563,6 +563,8 @@ <h2>Creating a navigation timing entry</h2>
563563
count</a> to |redirectCount|.
564564
<li>Set |navigationTimingEntry|'s <a data-for="PerformanceNavigationTiming">navigation
565565
type</a> to |navigationType|.
566+
<li>Set |navigationTimingEntry|'s [=PerformanceNavigationTiming/service worker timing=]
567+
to |serviceWorkerTiming|.
566568
<li>Set |document|'s <span>navigation timing entry</span> to |navigationTimingEntry|.
567569
<li>add |navigationTimingEntry| to |global|'s
568570
<a data-cite='performance-timeline-2#dfn-performance-entry-buffer'>performance entry buffer</a>.

0 commit comments

Comments
 (0)