Skip to content

Commit

Permalink
Revert timers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Feb 14, 2024
1 parent 76c9dd6 commit 1edd30b
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -109944,12 +109944,6 @@ interface mixin <dfn interface>WindowEventHandlers</dfn> {
DOMString <span data-x="dom-btoa">btoa</span>(DOMString data);
ByteString <span data-x="dom-atob">atob</span>(DOMString data);

// timers
long <span data-x="dom-setTimeout">setTimeout</span>(<span>TimerHandler</span> handler, optional long timeout = 0, any... arguments);
undefined <span data-x="dom-clearTimeout">clearTimeout</span>(optional long id = 0);
long <span data-x="dom-setInterval">setInterval</span>(<span>TimerHandler</span> handler, optional long timeout = 0, any... arguments);
undefined <span data-x="dom-clearInterval">clearInterval</span>(optional long id = 0);

// microtask queuing
undefined <span data-x="dom-queueMicrotask">queueMicrotask</span>(<span data-x="idl-VoidFunction">VoidFunction</span> <var>callback</var>);

Expand Down Expand Up @@ -110038,6 +110032,12 @@ interface mixin <dfn interface>WindowOrWorkerGlobalScope</dfn> {

undefined <span data-x="dom-reportError">reportError</span>(any e);

// timers
long <span data-x="dom-setTimeout">setTimeout</span>(<span>TimerHandler</span> handler, optional long timeout = 0, any... arguments);
undefined <span data-x="dom-clearTimeout">clearTimeout</span>(optional long id = 0);
long <span data-x="dom-setInterval">setInterval</span>(<span>TimerHandler</span> handler, optional long timeout = 0, any... arguments);
undefined <span data-x="dom-clearInterval">clearInterval</span>(optional long id = 0);

// ImageBitmap
Promise&lt;<span>ImageBitmap</span>&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image, optional <span>ImageBitmapOptions</span> options = {});
Promise&lt;<span>ImageBitmap</span>&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image, long sx, long sy, long sw, long sh, optional <span>ImageBitmapOptions</span> options = {});
Expand Down Expand Up @@ -110803,10 +110803,9 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {

<div w-nodev>

<p>Objects that implement the <code>WindowOrWorkerOrShadowRealmGlobalScope</code> mixin have a
<dfn export for="WindowOrWorkerOrShadowRealmGlobalScope">map of active timers</dfn>, which is a
<span>map</span>, initially empty.
Each <span data-x="map key">key</span> in this map is an identifier for a timer,
<p>Objects that implement the <code>WindowOrWorkerGlobalScope</code> mixin have a <dfn export
for="WindowOrWorkerGlobalScope">map of active timers</dfn>, which is a <span>map</span>,
initially empty. Each <span data-x="map key">key</span> in this map is an identifier for a timer,
and each <span data-x="map value">value</span> is a <code>DOMHighResTimeStamp</code>,
representing the expiry time for that timer.</p>

Expand All @@ -110822,21 +110821,21 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {

<hr>

<p>The <dfn method for="WindowOrWorkerOrShadowRealmGlobalScope" data-x="dom-setTimeout"><code
<p>The <dfn method for="WindowOrWorkerGlobalScope" data-x="dom-setTimeout"><code
id="dom-windowtimers-setTimeout">setTimeout(<var>handler</var>, <var>timeout</var>,
...<var>arguments</var>)</code></dfn> method steps are to return the result of running the
<span>timer initialization steps</span> given <span>this</span>, <var>handler</var>,
<var>timeout</var>, <var>arguments</var>, and false.</p>

<p>The <dfn method for="WindowOrWorkerOrShadowRealmGlobalScope" data-x="dom-setInterval"><code
<p>The <dfn method for="WindowOrWorkerGlobalScope" data-x="dom-setInterval"><code
id="dom-windowtimers-setInterval">setInterval(<var>handler</var>, <var>timeout</var>,
...<var>arguments</var>)</code></dfn> method steps are to return the result of running the
<span>timer initialization steps</span> given <span>this</span>, <var>handler</var>,
<var>timeout</var>, <var>arguments</var>, and true.</p>

<p>The <dfn method for="WindowOrWorkerOrShadowRealmGlobalScope" data-x="dom-clearTimeout"><code
<p>The <dfn method for="WindowOrWorkerGlobalScope" data-x="dom-clearTimeout"><code
id="dom-windowtimers-clearTimeout">clearTimeout(<var>id</var>)</code></dfn> and <dfn method
for="WindowOrWorkerOrShadowRealmGlobalScope" data-x="dom-clearInterval"><code
for="WindowOrWorkerGlobalScope" data-x="dom-clearInterval"><code
id="dom-windowtimers-clearInterval">clearInterval(<var>id</var>)</code></dfn> method steps
are to <span data-x="map remove">remove</span> <span>this</span>'s <span>map of active
timers</span>[<var>id</var>].</p>
Expand All @@ -110849,16 +110848,15 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
<hr>

<p>The <!--en-GB--><dfn id="timer-initialisation-steps">timer initialization steps</dfn>, given a
<code>WindowOrWorkerOrShadowRealmGlobalScope</code> <var>global</var>, a string or <code
<code>WindowOrWorkerGlobalScope</code> <var>global</var>, a string or <code
data-x="idl-Function">Function</code> <var>handler</var>, a number <var>timeout</var>, a list
<var>arguments</var>, a boolean <var>repeat</var>, and optionally (and only if <var>repeat</var>
is true) a number <var>previousId</var>, are:</p>

<ol>
<li><p>Let <var>thisArg</var> be <var>global</var>.</p></li>

<li><p>If <var>global</var> is a <code>Window</code> object, then set <var>thisArg</var> to the
<code>WindowProxy</code> that corresponds to <var>global</var>.</p></li>
<li><p>Let <var>thisArg</var> be <var>global</var> if that is a <code>WorkerGlobalScope</code>
object; otherwise let <var>thisArg</var> be the <code>WindowProxy</code> that corresponds to
<var>global</var>.</p></li>

<li><p>If <var>previousId</var> was given, let <var>id</var> be <var>previousId</var>;
otherwise, let <var>id</var> be an <span>implementation-defined</span> integer that is greater
Expand Down Expand Up @@ -110913,8 +110911,8 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
If this throws an exception, catch it, <span>report the exception</span>, and abort these
steps.</p></li>

<li><p>Let <var>settings object</var> be <var>realm</var>'s <span>principal realm</span>'s
<span data-x="concept-realm-settings-object">environment settings object</span>.</p></li>
<li><p>Let <var>settings object</var> be <var>global</var>'s <span>relevant settings
object</span>.</p></li>

<li><p>Let <var>fetch options</var> be the <span>default classic script fetch
options</span>.</p></li>
Expand Down Expand Up @@ -111044,10 +111042,9 @@ scheduleWork(); // queues a task to do lots of work</code></pre>

<div w-nodev>

<p>To <dfn export>run steps after a timeout</dfn>, given
a <code>WindowOrWorkerOrShadowRealmGlobalScope</code> <var>global</var>,
a string <var>orderingIdentifier</var>, a number <var>milliseconds</var>,
a set of steps <var>completionSteps</var>, and an optional value <var>timerKey</var>:</p>
<p>To <dfn export>run steps after a timeout</dfn>, given a <code>WindowOrWorkerGlobalScope</code>
<var>global</var>, a string <var>orderingIdentifier</var>, a number <var>milliseconds</var>, a
set of steps <var>completionSteps</var>, and an optional value <var>timerKey</var>:</p>

<ol>
<li><p><span>Assert</span>: if <var>timerKey</var> is given, then the caller of this algorithm is
Expand All @@ -111069,8 +111066,6 @@ scheduleWork(); // queues a task to do lots of work</code></pre>

<ol>
<li>
<p class="XXX">Need to handle shadow realms here.</p>

<p>If <var>global</var> is a <code>Window</code> object, wait until <var>global</var>'s <span
data-x="concept-document-window">associated <code>Document</code></span> has been <span>fully
active</span> for a further <var>milliseconds</var> milliseconds (not necessarily
Expand Down

0 comments on commit 1edd30b

Please sign in to comment.