Skip to content

Commit 1f0ac4b

Browse files
authored
Upstream Long Animation Frames monkey-patches
Long Animation Frames (https://w3c.github.io/long-animation-frames/) expects a few calls from HTML and other specs, for reporting when tasks, rendering or JS entry points take place. This moves those calls from the Long Animation Frames spec to HTML.
1 parent c1b467a commit 1f0ac4b

File tree

1 file changed

+65
-6
lines changed

1 file changed

+65
-6
lines changed

source

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,6 +2762,24 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
27622762
</ul>
27632763
</dd>
27642764

2765+
<dt>Long Animation Frames</dt>
2766+
2767+
<dd>
2768+
<p>The following terms are defined in <cite>Long Animation Frames</cite>: <ref>LONGANIMATIONFRAMES</ref></p>
2769+
2770+
<ul class="brief">
2771+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-task-start-time">record task start time</dfn></li>
2772+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-task-end-time">record task end time</dfn></li>
2773+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-rendering-time">record rendering time</dfn></li>
2774+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-classic-script-creation-time">record classic script creation time</dfn></li>
2775+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-classic-script-execution-start-time">record classic script execution start time</dfn></li>
2776+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-module-script-execution-start-time">record module script execution start time</dfn></li>
2777+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-pause-duration">Record pause duration</dfn></li>
2778+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-timing-info-for-timer-handler">record timing info for timer handler</dfn></li>
2779+
<li><dfn data-x-href="https://w3c.github.io/long-animation-frames/#record-timing-info-for-microtask-checkpoint">record timing info for microtask checkpoint</dfn></li>
2780+
</ul>
2781+
</dd>
2782+
27652783
<dt>Long Tasks</dt>
27662784

27672785
<dd>
@@ -3385,6 +3403,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
33853403
current time</dfn>, the <dfn
33863404
data-x-href="https://w3c.github.io/hr-time/#dfn-shared-monotonic-clock">shared monotonic clock</dfn>,
33873405
the <dfn data-x-href="https://w3c.github.io/hr-time/#dfn-unsafe-moment">unsafe moment</dfn>,
3406+
the <dfn data-x-href="https://w3c.github.io/hr-time/#dfn-duration-from">duration from</dfn>,
33883407
the <dfn data-x-href="https://w3c.github.io/hr-time/#dfn-coarsen-time">coarsen time</dfn>
33893408
algorithm, and the <dfn
33903409
data-x-href="https://w3c.github.io/hr-time/#dom-domhighrestimestamp"><code>DOMHighResTimeStamp</code></dfn>
@@ -106349,8 +106368,8 @@ document.querySelector("button").addEventListener("click", bound);
106349106368

106350106369
<li><p>Let <var>script</var> be the result of <span>creating a classic script</span> given
106351106370
<var>sourceText</var>, <var>settingsObject</var>, <var>response</var>'s <span
106352-
data-x="concept-response-url">URL</span>, <var>options</var>, and
106353-
<var>mutedErrors</var>.</p></li>
106371+
data-x="concept-response-url">URL</span>, <var>options</var>,
106372+
<var>mutedErrors</var>, and <var>url</var>.</p></li>
106354106373

106355106374
<li>Run <var>onComplete</var> given <var>script</var>.</li>
106356106375
</ol>
@@ -107030,7 +107049,8 @@ document.querySelector("button").addEventListener("click", bound);
107030107049
<p>To <dfn data-x="creating a classic script">create a classic script</dfn>, given a
107031107050
<span>string</span> <var>source</var>, an <span>environment settings object</span>
107032107051
<var>settings</var>, a <span>URL</span> <var>baseURL</var>, a <span>script fetch options</span>
107033-
<var>options</var>, and an optional boolean <var>mutedErrors</var> (default false):</p>
107052+
<var>options</var>, an optional boolean <var>mutedErrors</var> (default false), and an optional
107053+
<span>URL</span>-or-null <var>sourceURLForWindowScripts</var> (default null):</p>
107034107054

107035107055
<ol>
107036107056
<li>
@@ -107063,6 +107083,9 @@ document.querySelector("button").addEventListener("click", bound);
107063107083
<li><p>Set <var>script</var>'s <span data-x="concept-script-parse-error">parse error</span> and
107064107084
<span data-x="concept-script-error-to-rethrow">error to rethrow</span> to null.</p></li>
107065107085

107086+
<li><p><span>Record classic script creation time</span> given <var>script</var> and
107087+
<var>sourceURLForWindowScripts</var>.</p></li>
107088+
107066107089
<li>
107067107090
<p>Let <var>result</var> be <span data-x="js-ParseScript">ParseScript</span>(<var>source</var>,
107068107091
<var>settings</var>'s <span data-x="environment settings object's realm">realm</span>,
@@ -107344,6 +107367,8 @@ document.querySelector("button").addEventListener("click", bound);
107344107367
<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
107345107368
not run" then return <span>NormalCompletion</span>(empty).</p></li>
107346107369

107370+
<li><p><span>Record classic script execution start time</span> given <var>script</var>.</p></li>
107371+
107347107372
<li><p><span>Prepare to run script</span> given <var>settings</var>.</p></li>
107348107373

107349107374
<li><p>Let <var>evaluationStatus</var> be null.</p></li>
@@ -107426,6 +107451,8 @@ document.querySelector("button").addEventListener("click", bound);
107426107451
<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do not
107427107452
run", then return <span>a promise resolved with</span> with undefined.</p></li>
107428107453

107454+
<li><p><span>Record module script execution start time</span> given <var>script</var>.</p></li>
107455+
107429107456
<li><p><span>Prepare to run script</span> given <var>settings</var>.</p></li>
107430107457

107431107458
<li><p>Let <var>evaluationPromise</var> be null.</p></li>
@@ -109675,6 +109702,10 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
109675109702
<var>taskQueue</var>, and <span data-x="list remove">remove</span> it from
109676109703
<var>taskQueue</var>.</p></li>
109677109704

109705+
<li><p>If <var>oldestTask</var>'s <span data-x="concept-task-document">document</span> is not
109706+
null, then <span>record task start time</span> given <var>taskStartTime</var> and
109707+
<var>oldestTask</var>'s <span data-x="concept-task-document">document</span>.</p></li>
109708+
109678109709
<li><p>Set the <span>event loop</span>'s <span>currently running task</span> to
109679109710
<var>oldestTask</var>.</p></li>
109680109711

@@ -109687,7 +109718,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
109687109718
</ol>
109688109719
</li>
109689109720

109690-
<li><p>Let <var>now</var> be the <span>unsafe shared current time</span>. <ref>HRT</ref></p></li>
109721+
<li><p>Let <var>taskEndTime</var> be the <span>unsafe shared current time</span>.
109722+
<ref>HRT</ref></p></li>
109691109723

109692109724
<li>
109693109725
<p>If <var>oldestTask</var> is not null, then:</p>
@@ -109717,9 +109749,13 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
109717109749
</ol>
109718109750
</li>
109719109751

109720-
<li><p><span>Report long tasks</span>, passing in <var>taskStartTime</var>, <var>now</var> (the
109721-
end time of the task), <var>top-level browsing contexts</var>, and
109752+
<li><p><span>Report long tasks</span>, passing in <var>taskStartTime</var>,
109753+
<var>taskEndTime</var>, <var>top-level browsing contexts</var>, and
109722109754
<var>oldestTask</var>.</p></li>
109755+
109756+
<li><p>If <var>oldestTask</var>'s <span data-x="concept-task-document">document</span> is not
109757+
null, then <span>record task end time</span> given <var>taskEndTime</var> and
109758+
<var>oldestTask</var>'s <span data-x="concept-task-document">document</span>.</p></li>
109723109759
</ol>
109724109760
</li>
109725109761

@@ -110004,6 +110040,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
110004110040
given <var>frameTimestamp</var> and <var>doc</var>'s <span>relevant global object</span> as
110005110041
the timestamp.</p></li>
110006110042

110043+
<li><p>Let <var>unsafeLayoutStartTime</var> be the <span>unsafe shared current
110044+
time</span>.</p>
110045+
110007110046
<li>
110008110047
<p>For each <var>doc</var> of <var>docs</var>:</p>
110009110048

@@ -110102,6 +110141,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
110102110141
time</span> given <var>now</var> and <var>doc</var>'s <span>relevant global object</span> as
110103110142
the timestamp. <ref>INTERSECTIONOBSERVER</ref></p></li>
110104110143

110144+
<li><p>For each <var>doc</var> of <var>docs</var>, <span>record rendering time</span> for
110145+
<var>doc</var> given <var>unsafeStyleAndLayoutStartTime</var>.</p></li>
110146+
110105110147
<li><p>For each <var>doc</var> of <var>docs</var>, <span>mark paint timing</span> for
110106110148
<var>doc</var>.</p></li>
110107110149

@@ -110187,6 +110229,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
110187110229

110188110230
<li><p>Set the <span>event loop</span>'s <span>performing a microtask checkpoint</span> to
110189110231
false.</p></li>
110232+
110233+
<li><p><span>Record timing info for microtask checkpoint</span>.</p></li>
110190110234
</ol>
110191110235

110192110236
<hr>
@@ -110395,6 +110439,11 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
110395110439
<var>goal</var> is met. This means running the following steps:</p>
110396110440

110397110441
<ol>
110442+
<li><p>Let <var>global</var> be the <span>current global object</span>.</p></li>
110443+
110444+
<li><p>Let <var>timeBeforePause</var> be the <span>current high resolution time</span> given
110445+
<var>global</var>.</p></li>
110446+
110398110447
<li><p>If necessary, update the rendering or user interface of any <code>Document</code> or
110399110448
<span>navigable</span> to reflect the current state.</p></li>
110400110449

@@ -110404,6 +110453,10 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
110404110453
data-x="concept-task">task</span> must block. User agents should remain responsive to user input
110405110454
while paused, however, albeit in a reduced capacity since the <span>event loop</span> will not be
110406110455
doing anything.</p></li>
110456+
110457+
<li><p><span>Record pause duration</span> given the <span>duration from</span>
110458+
<var>timeBeforePause</var> to the <span>current high resolution time</span> given
110459+
<var>global</var>.</p></li>
110407110460
</ol>
110408110461

110409110462
<div class="warning">
@@ -112712,6 +112765,9 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
112712112765
<li><p>If <var>id</var> does not <span data-x="map exists">exist</span> in <var>global</var>'s
112713112766
<span>map of active timers</span>, then abort these steps.</p></li>
112714112767

112768+
<li><p><span>Record timing info for timer handler</span> given <var>handler</var>, <var>global</var>'s
112769+
<span>relevant settings object</span>, and <var>repeat</var>.</p></li>
112770+
112715112771
<li><p>If <var>handler</var> is a <code data-x="idl-Function">Function</code>, then <span
112716112772
data-x="es-invoking-callback-functions">invoke</span> <var>handler</var> given
112717112773
<var>arguments</var> with the <span data-x="dfn-callback-this-value">callback this
@@ -142233,6 +142289,9 @@ INSERT INTERFACES HERE
142233142289
<dt id="refsLONGTASKS">[LONGTASKS]</dt>
142234142290
<dd><cite><a href="https://w3c.github.io/longtasks/">Long Tasks</a></cite>, D. Denicola, I. Grigorik, S. Panicker. W3C.</dd>
142235142291

142292+
<dt id="refsLONGANIMATIONFRAMES">[LONGANIMATIONFRAMES]</dt>
142293+
<dd><cite><a href="https://w3c.github.io/long-animation-frames/">Long Animation Frames</a></cite>, N. Rosenthal. W3C.</dd>
142294+
142236142295
<dt id="refsMAILTO">[MAILTO]</dt>
142237142296
<dd>(Non-normative) <cite><a href="https://www.rfc-editor.org/rfc/rfc6068">The 'mailto' URI scheme</a></cite>, M. Duerst, L. Masinter, J. Zawinski. IETF.</dd>
142238142297

0 commit comments

Comments
 (0)