Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
* Fix typos
* Remove getEntriesByNavigationId()
* Convert timestamps to strings for concatenation
  • Loading branch information
clelland committed Oct 4, 2023
1 parent 1497e2a commit 8e34f8f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 35 deletions.
8 changes: 4 additions & 4 deletions explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ The web performance monitoring service can process all the performance informati
When this API was originally designed, documents had a relatively simple lifecycle: they were
loaded when the user navigated to them, and unloaded when the user navigated away, with the
JavaScript environment being torn down at that time. Since then, the sitution has become more
complex, with many browsers introducing a back-forwards-cache, with which a user can return
a document wich they have previously navigated away from. The web has also seen a rise in
complex, with many browsers introducing a back-forward cache, with which a user can return to
a document which they have previously navigated away from. The web has also seen a rise in
popularity of Single Page Apps, where what appears to the user to be a navigation is actually
just a change in state of a running page. In both of these situations, a navigation (or what
appears to the user as a navigation) can occur without the performance timeline being reset.
In order to allow developers to reason about such events during the life of a page, some
PerformanceEntry objects mark navigations, or navigation-like events. All PerformanceEntry
objects include a navigation ID field, which links each PerformanceEntry to the most recent
navigation entry which had occurred when the entry was generated.
objects include a navigation ID field, which ties each PerformanceEntry to the most recent
navigation entry which had occurred before the entry was generated.

# Standards Status
The Performance Timeline specification is widely approved.
Expand Down
57 changes: 26 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"check-punctuation": true,
},
doJsonLd: true,
xref: ["hr-time-3", "infra", "html", "dom"],
xref: ["hr-time-3", "infra", "html", "dom", 'ecmascript'],
mdn: "performance-timeline",
};
</script>
Expand Down Expand Up @@ -249,7 +249,7 @@ <h2><dfn>Performance Timeline</dfn></h2>
</ul>
<p>Each <a>Document</a> has:</p>
<ul>
<li>a <dfn>most recent navigation</dfn>, which is a <a>PerformanceEntry</a>,
<li>A <dfn>most recent navigation</dfn>, which is a <a>PerformanceEntry</a>,
initially unset.
</li>
</ul>
Expand Down Expand Up @@ -598,7 +598,6 @@ <h2><dfn>PerformanceObserverEntryList</dfn> interface</h2>
PerformanceEntryList getEntries();
PerformanceEntryList getEntriesByType (DOMString type);
PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
PerformanceEntryList getEntriesByNavigationId (DOMString navigationId);
};
</pre>
<p>Each {{PerformanceObserverEntryList}} object has an associated
Expand All @@ -607,34 +606,24 @@ <h2><dfn>PerformanceObserverEntryList</dfn> interface</h2>
<section>
<h2><dfn>getEntries()</dfn> method</h2>
<p>Returns a <a>PerformanceEntryList</a> object returned by <a>filter
buffer</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var>, <var>type</var> and <var>navigationId</var> set to
<code>null</code>.</p>
buffer by name and type</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var> and <var>type</var> set to <code>null</code>.</p>
</section>
<section>
<h2><dfn>getEntriesByType()</dfn> method</h2>
<p>Returns a <a>PerformanceEntryList</a> object returned by <a>filter
buffer</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var> set to <code>null</code>, <var>type</var> set to the
method's input <code>type</code> parameter, and <var>navigationId</var>
set to <code>null</code>.</p>
buffer by name and type</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var> set to <code>null</code>, and <var>type</var> set to the
method's input <code>type</code> parameter.</p>
</section>
<section>
<h2><dfn>getEntriesByName()</dfn> method</h2>
<p>Returns a <a>PerformanceEntryList</a> object returned by <a>filter
buffer</a> algorithm with <a>this</a>'s <a>entry list</a>,
buffer by name and type</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var> set to the method input <code>name</code> parameter, and
<var>type</var> set to <code>null</code> if optional `entryType` is omitted,
or set to the method's input <code>type</code> parameter otherwise.</p>
</section>
<section>
<h2><dfn>getEntriesByNavigationId()</dfn> method</h2>
<p>Returns a <a>PerformanceEntryList</a> object returned by <a>filter
buffer</a> algorithm with <a>this</a>'s <a>entry list</a>,
<var>name</var> and <var>type</var> set to <code>null</code>, and
<var>navigationId</var> set to the method's input
<code>navigationId</code> parameter.</p>
</section>
</section>
</section>
<section>
Expand Down Expand Up @@ -878,7 +867,7 @@ <h2>Filter buffer map by name and type</h2>
continue to the next <var>tuple</var>.
</li>
<li>Let <var>entries</var> be the result of running <a>filter
buffer</a> with <var>buffer</var>, <var>name</var>
buffer by name and type</a> with <var>buffer</var>, <var>name</var>
and <var>type</var> as inputs.
</li>
<li>For each <var>entry</var> in <var>entries</var>,
Expand All @@ -892,10 +881,10 @@ <h2>Filter buffer map by name and type</h2>
</ol>
</section>
<section data-link-for="PerformanceEntry">
<h2>Filter buffer</h2>
<p>When asked to run the <dfn>filter buffer</dfn>
algorithm, with <var>buffer</var>, <var>name</var>, <var>type</var>, and
<var>navigationId</var> as inputs, run the following steps:</p>
<h2>Filter buffer by name and type</h2>
<p>When asked to run the <dfn>filter buffer by name and type</dfn>
algorithm, with <var>buffer</var>, <var>name</var>, and <var>type</var>
as inputs, run the following steps:</p>
<ol>
<li>Let <var>result</var> be an initially empty <a>list</a>.
</li>
Expand All @@ -910,12 +899,6 @@ <h2>Filter buffer</h2>
<a data-cite=INFRA#string-is>identical to</a> <var>entry</var>'s
<code>name</code> attribute, continue to next <var>entry</var>.
</li>
<li>If <var>navigationId</var> is not null and if
<var>navigationId</var> is not
<a data-cite=INFRA#string-is>identical to</a> <var>entry</var>'s
<code>navigationId</code> attribute, continue to next
<var>entry</var>.
</li>
<li>[=list/append=] <var>entry</var> to <var>result</var>.</li>
</ol>
</li>
Expand Down Expand Up @@ -948,9 +931,21 @@ <h2>Generate a navigationId</h2>
<ol>
<li>Let <var>type</var> be <var>entry</var>'s <a>entryType</a>.</li>
<li>Let <var>startTime</var> be <var>entry</var>'s <a>startTime</a>.
<li>Let <var>timeString</var> be the result of calling
{{Number/toString(radix)}}(<var>startTime</var>, 10).
</li>
<li>If <var>timeString</var> contains the code point U+002E FULL STOP:
<ol>
<li><a>Assert</a>: <var>timeString</var> contains only one instance
of U+002E FULL STOP.</li>
<li><a>Assert</a>: <var>timeString</var> contains at least one code
point following the U+002E FULL STOP code point.</li>
<li>Truncate <var>timeString</var> after the first code point
following the U+002E FULL STOP code point.</li>
</ol>
</li>
<li>Return the [=string/concatenation=] of « <var>type</var>,
<var>time</var> » using U+002D HYPHEN-MINUS.</li>
<var>timeString</var> » using U+002D HYPHEN-MINUS.</li>
</ol>
</section>
</section>
Expand Down

0 comments on commit 8e34f8f

Please sign in to comment.