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 navigationId to PerformanceEntry #192

Merged
merged 11 commits into from
Oct 11, 2023
24 changes: 24 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
</li>
<li>Exposes {{PerformanceEntry}} in Web Workers [[WORKERS]];
</li>
<li>Formalizes support for multiple navigation events over a document's
lifetime.
</li>
<li>Adds support for {{PerformanceObserver}}.
</li>
</ul>
Expand Down Expand Up @@ -246,6 +249,7 @@ <h2><dfn>Performance Timeline</dfn></h2>
<li>An integer <dfn>dropped entries count</dfn> that is initially 0.</li>
</ul>
</li>
<li>An integer <dfn>current navigation id</dfn> that is initially 0.</li>
</ul>
<p>In order to get the <dfn>relevant performance entry tuple</dfn>, given
<var>entryType</var> and <var>globalObject</var> as input, run the
Expand All @@ -258,6 +262,17 @@ <h2><dfn>Performance Timeline</dfn></h2>
map</var>, given <var>entryType</var> as the <a>key</a>.
</li>
</ol>
<p>The <a
href="https://html.spec.whatwg.org/#session-history-document-visibility-change-steps">session
clelland marked this conversation as resolved.
Show resolved Hide resolved
history document visibility change steps</a> defined by this specification are:</p>
<ol>
<li>Increment <var>newDocument</var>'s [=relevant global object=]'s <a>current navigation
id</a>.</li>
</ol>
<p class="note">These steps will be called from [[HTML]]'s <a
href="https://html.spec.whatwg.org/#traverse-the-history">traverse the history</a>
algorithm whenever a document is restored from the bfcache, immediately before the
[=Window/pageshow=] event is fired.</p>
<section data-dfn-for="Performance" data-link-for="Performance">
<h2>Extensions to the {{Performance}} interface</h2>
<p>This extends the {{Performance}} interface from [[HR-TIME-3]] and
Expand Down Expand Up @@ -308,6 +323,7 @@ <h2>The <dfn>PerformanceEntry</dfn> interface</h2>
readonly attribute DOMString entryType;
readonly attribute DOMHighResTimeStamp startTime;
readonly attribute DOMHighResTimeStamp duration;
readonly attribute unsigned long navigationId;
[Default] object toJSON();
};</pre>
<dl>
Expand Down Expand Up @@ -344,6 +360,12 @@ <h2>The <dfn>PerformanceEntry</dfn> interface</h2>
duration concept doesn't apply, a performance metric may choose to
return a `duration` of <code>0</code>.
</dd>
<dt><dfn>navigationId</dfn></dt>
<dd>
This attribute MUST return the value of the global object's <a>current
clelland marked this conversation as resolved.
Show resolved Hide resolved
navigation id</a> at the time that this <a>PerformanceEntry</a> was
queued.
</dd>
</dl>
<p>When <dfn>toJSON</dfn> is called, run [[WebIDL]]'s <a>default toJSON
steps</a>.</p>
Expand Down Expand Up @@ -672,6 +694,8 @@ <h2>Queue a <code>PerformanceEntry</code></h2>
<li>Let <var>relevantGlobal</var> be <var>newEntry</var>'s <a>relevant
global object</a>.
</li>
<li>Set <var>newEntry</var>'s <a data-lt="PerformanceEntry.navigationId">navigationId</a>
to <var>relevantGlobal</var>'s <a>current navigation id</a>.</li>
<li>For each <a>registered performance observer</a> <var>regObs</var> in
<var>relevantGlobal</var>'s <a>list of registered performance observer objects</a>:
<ol>
Expand Down