Skip to content

Commit 6cc33a0

Browse files
authored
WebIDL fix: initialize PerformanceEntry instead of shadowing (#383)
* WebIDL fix: initialize PerformanceEntry instead of shadowing * Fix ref * global
1 parent 23da0c2 commit 6cc33a0

File tree

1 file changed

+11
-58
lines changed

1 file changed

+11
-58
lines changed

index.html

+11-58
Original file line numberDiff line numberDiff line change
@@ -420,60 +420,6 @@ <h3>
420420
{{RenderBlockingStatusType}} <a data-dfn-for=
421421
"PerformanceResourceTiming"><dfn>render-blocking status</dfn></a>.
422422
</p>
423-
<p>
424-
The <a>PerformanceResourceTiming</a> interface participates in the
425-
<a data-cite=
426-
"PERFORMANCE-TIMELINE-2#performance-timeline">Performance
427-
Timeline</a> and extends the following attributes of the
428-
<code><dfn data-cite=
429-
"PERFORMANCE-TIMELINE-2#the-performanceentry-interface">PerformanceEntry</dfn></code>
430-
interface:
431-
</p>
432-
<dl data-link-for="PerformanceResourceTiming">
433-
<dt>
434-
<dfn>name</dfn>
435-
</dt>
436-
<dd>
437-
The <a>name</a> getter steps are to return <a>this</a>'s
438-
<a data-for="PerformanceResourceTiming">requested URL</a>.
439-
</dd>
440-
<dt>
441-
<dfn>entryType</dfn>
442-
</dt>
443-
<dd>
444-
The <a>entryType</a> getter steps are to return the DOMString
445-
"<code>resource</code>".
446-
</dd>
447-
<dt>
448-
<dfn>startTime</dfn>
449-
</dt>
450-
<dd>
451-
<p data-dfn-for="PerformanceResourceTiming">
452-
The <a>startTime</a> getter steps are to <a>convert fetch
453-
timestamp</a> for <a>this</a>'s <a data-for=
454-
"PerformanceResourceTiming">timing info</a>'s [=fetch timing
455-
info/start time=] and <a>this</a>'s <a>relevant global
456-
object</a>.
457-
</p>
458-
<p class='note'>
459-
`startTime` is measured right at the start of the [=fetch=],
460-
before any redirects. See <a data-cite=
461-
"FETCH#fetching">fetching</a>.
462-
</p>
463-
</dd>
464-
<dt>
465-
<dfn>duration</dfn>
466-
</dt>
467-
<dd>
468-
<p data-dfn-for="PerformanceResourceTiming">
469-
The <a>duration</a> getter steps are to return <a>this</a>'s
470-
<a data-for="PerformanceResourceTiming">timing info</a>'s [=fetch
471-
timing info/end time=] minus <a>this</a>'s <a data-for=
472-
"PerformanceResourceTiming">timing info</a>'s [=fetch timing
473-
info/start time=].
474-
</p>
475-
</dd>
476-
</dl>
477423
<p data-dfn-for="PerformanceResourceTiming">
478424
When <dfn>toJSON</dfn> is called, run [[WEBIDL]]'s <a data-cite=
479425
"WEBIDL#default-tojson-operation">default toJSON operation</a>.
@@ -899,15 +845,12 @@ <h3>
899845
</li>
900846
</ol>
901847
<p>
902-
To <dfn>add a PerformanceResourceTiming entry</dfn> into the
848+
To <dfn>add a PerformanceResourceTiming entry</dfn> <i>new entry</i> into the
903849
<a data-cite=
904850
'PERFORMANCE-TIMELINE-2/#dfn-performance-entry-buffer'>performance
905851
entry buffer</a>, run the following steps:
906852
</p>
907853
<ol>
908-
<li>Let <i>new entry</i> be the input <a>PerformanceEntry</a> to be
909-
added.
910-
</li>
911854
<li>If <a>can add resource timing entry</a> returns true and
912855
<a>resource timing buffer full event pending flag</a> is false, run
913856
the following substeps:
@@ -1185,6 +1128,7 @@ <h2>
11851128
<li>Create a <a>PerformanceResourceTiming</a> object |entry| in
11861129
|global|'s [=global object/realm=].
11871130
</li>
1131+
11881132
<li>
11891133
<a>Setup the resource timing entry</a> for |entry|, given
11901134
|initiatorType|, |requestedURL|, |timingInfo|, |cacheMode|,
@@ -1214,6 +1158,15 @@ <h2>
12141158
<li>Assert that |cacheMode| is the empty string,
12151159
"<code>local</code>", or "<code>validated</code>".
12161160
</li>
1161+
1162+
<li>Let |global| be |entry|'s [=relevant global object=].</li>
1163+
1164+
<li>[=initialize a PerformanceEntry|Initialize=] |entry| given
1165+
the result of <a data-lt="convert fetch timestamp">converting</a> |timingInfo|'s
1166+
[=fetch timing info/start time=] given |global|, "<code>resource</code>",
1167+
|requestedURL|, and the result of <a data-lt="convert fetch timestamp">converting</a>
1168+
|timingInfo|'s [=fetch timing info/end time=] given |global|.
1169+
</li>
12171170
<li>Set |entry|'s <a data-for="PerformanceResourceTiming">initiator
12181171
type</a> to |initiatorType|.
12191172
</li>

0 commit comments

Comments
 (0)