You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and <code>"resource"</code> [[RESOURCE-TIMING-2]].</p>
347
340
</dd>
348
341
<dt><dfn>startTime</dfn></dt>
349
-
<dd>This attribute MUST return the time value of the first recorded
350
-
timestamp of this performance metric. If the startTime concept doesn't
351
-
apply, a performance metric may choose to return a `startTime` of
352
-
<code>0</code>.</dd>
342
+
<dd>This attribute must return the value it is initialized to. It represents the time value of
343
+
the first recorded timestamp of this performance metric. Its initial value is <code>0</code>.</dd>
353
344
<dt><dfn>duration</dfn></dt>
354
345
<dd>
355
-
This attribute MUST return the time value of the duration of the entire
356
-
event being recorded by this <a>PerformanceEntry</a>. Typically, this
357
-
would be the time difference between the last recorded timestamp and
358
-
the first recorded timestamp of this <a>PerformanceEntry</a>. If the
359
-
duration concept doesn't apply, a performance metric may choose to
360
-
return a `duration` of <code>0</code>.
346
+
The getter steps for the <a>duration</a> attribute are to return 0 if <a>this</a>'s <a>endTime</a>
347
+
is 0; otherwise <a>this</a>'s <a>endTime</a> - <a>this</a>'s <a>startTime</a>.
361
348
</dd>
362
349
<dt><dfn>navigationId</dfn></dt>
363
350
<dd>
364
-
This attribute MUST return the value of <a>this</a>'s <a>navigationId</a>.
351
+
This attribute MUST return the value of it is initialized to.
365
352
</dd>
366
353
</dl>
367
354
<p>When <dfn>toJSON</dfn> is called, run [[WebIDL]]'s <a>default toJSON
368
355
steps</a>.</p>
356
+
357
+
<p>A <a>PerformanceEntry</a> has a {{DOMHighResTimeStamp}} <dfnfor="PerformanceEntry">endTime</dfn>,
358
+
initially 0.
359
+
360
+
<p>To <dfnclass="export">initialize a <a>PerformanceEntry</a></dfn><var>entry</var> given a {{DOMHighResTimeStamp}} <var>startTime</var>,
361
+
a <code>DOMString</code><var>entryType</var>, a <code>DOMString</code> name, and an optional {{DOMHighResTimeStamp}} <var>endTime</var> (default <code>0</code>):
362
+
363
+
<ol>
364
+
<li>Assert: <var>entryType</var> is defined in the <ahref="https://w3c.github.io/timing-entrytypes-registry/#registry">entry type registry</a>.
365
+
<li>Set <var>entry</var>'s <a>startTime</a> to <var>startTime</var>.
366
+
<li>Set <var>entry</var>'s <a>entryType</a> to <var>entryType</var>.
367
+
<li>Set <var>entry</var>'s <a>name</a> to <var>name</var>.
368
+
<li>Set <var>entry</var>'s <a>endTime</a> to <var>endTime</var>.
0 commit comments