Skip to content

Commit

Permalink
WebIDL fix: initialize PerformanceEntry instead of shadowing (#383)
Browse files Browse the repository at this point in the history
* WebIDL fix: initialize PerformanceEntry instead of shadowing

* Fix ref

* global
  • Loading branch information
noamr authored Feb 8, 2024
1 parent 23da0c2 commit 6cc33a0
Showing 1 changed file with 11 additions and 58 deletions.
69 changes: 11 additions & 58 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,60 +420,6 @@ <h3>
{{RenderBlockingStatusType}} <a data-dfn-for=
"PerformanceResourceTiming"><dfn>render-blocking status</dfn></a>.
</p>
<p>
The <a>PerformanceResourceTiming</a> interface participates in the
<a data-cite=
"PERFORMANCE-TIMELINE-2#performance-timeline">Performance
Timeline</a> and extends the following attributes of the
<code><dfn data-cite=
"PERFORMANCE-TIMELINE-2#the-performanceentry-interface">PerformanceEntry</dfn></code>
interface:
</p>
<dl data-link-for="PerformanceResourceTiming">
<dt>
<dfn>name</dfn>
</dt>
<dd>
The <a>name</a> getter steps are to return <a>this</a>'s
<a data-for="PerformanceResourceTiming">requested URL</a>.
</dd>
<dt>
<dfn>entryType</dfn>
</dt>
<dd>
The <a>entryType</a> getter steps are to return the DOMString
"<code>resource</code>".
</dd>
<dt>
<dfn>startTime</dfn>
</dt>
<dd>
<p data-dfn-for="PerformanceResourceTiming">
The <a>startTime</a> getter steps are to <a>convert fetch
timestamp</a> for <a>this</a>'s <a data-for=
"PerformanceResourceTiming">timing info</a>'s [=fetch timing
info/start time=] and <a>this</a>'s <a>relevant global
object</a>.
</p>
<p class='note'>
`startTime` is measured right at the start of the [=fetch=],
before any redirects. See <a data-cite=
"FETCH#fetching">fetching</a>.
</p>
</dd>
<dt>
<dfn>duration</dfn>
</dt>
<dd>
<p data-dfn-for="PerformanceResourceTiming">
The <a>duration</a> getter steps are to return <a>this</a>'s
<a data-for="PerformanceResourceTiming">timing info</a>'s [=fetch
timing info/end time=] minus <a>this</a>'s <a data-for=
"PerformanceResourceTiming">timing info</a>'s [=fetch timing
info/start time=].
</p>
</dd>
</dl>
<p data-dfn-for="PerformanceResourceTiming">
When <dfn>toJSON</dfn> is called, run [[WEBIDL]]'s <a data-cite=
"WEBIDL#default-tojson-operation">default toJSON operation</a>.
Expand Down Expand Up @@ -899,15 +845,12 @@ <h3>
</li>
</ol>
<p>
To <dfn>add a PerformanceResourceTiming entry</dfn> into the
To <dfn>add a PerformanceResourceTiming entry</dfn> <i>new entry</i> into the
<a data-cite=
'PERFORMANCE-TIMELINE-2/#dfn-performance-entry-buffer'>performance
entry buffer</a>, run the following steps:
</p>
<ol>
<li>Let <i>new entry</i> be the input <a>PerformanceEntry</a> to be
added.
</li>
<li>If <a>can add resource timing entry</a> returns true and
<a>resource timing buffer full event pending flag</a> is false, run
the following substeps:
Expand Down Expand Up @@ -1185,6 +1128,7 @@ <h2>
<li>Create a <a>PerformanceResourceTiming</a> object |entry| in
|global|'s [=global object/realm=].
</li>

<li>
<a>Setup the resource timing entry</a> for |entry|, given
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|,
Expand Down Expand Up @@ -1214,6 +1158,15 @@ <h2>
<li>Assert that |cacheMode| is the empty string,
"<code>local</code>", or "<code>validated</code>".
</li>

<li>Let |global| be |entry|'s [=relevant global object=].</li>

<li>[=initialize a PerformanceEntry|Initialize=] |entry| given
the result of <a data-lt="convert fetch timestamp">converting</a> |timingInfo|'s
[=fetch timing info/start time=] given |global|, "<code>resource</code>",
|requestedURL|, and the result of <a data-lt="convert fetch timestamp">converting</a>
|timingInfo|'s [=fetch timing info/end time=] given |global|.
</li>
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">initiator
type</a> to |initiatorType|.
</li>
Expand Down

0 comments on commit 6cc33a0

Please sign in to comment.