@@ -32,6 +32,9 @@ determine task execution order across [=scheduler task queues=] of the same {{Ta
32
32
all {{Scheduler}}s associated with the same [ =event loop=] . A timestamp would also suffice as long
33
33
as it is guaranteed to be strictly increasing and unique.
34
34
35
+ Add: An [ =event loop=] has a <dfn for =" event loop " >current scheduling state</dfn > (a [ =scheduling
36
+ state=] or null), which is initialized to null.
37
+
35
38
### <a href =" https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model " >Event loop: processing model</a > ### {#sec-patches-html-event-loop-processing}
36
39
37
40
Add the following steps to the event loop processing steps, before step 2:
@@ -56,3 +59,48 @@ Issue: The |taskQueue| in this step will either be a [=set=] of [=tasks=] or a [
56
59
[ =scheduler tasks=] . The steps that follow only [ =set/remove=] an [ =set/item=] , so they are
57
60
* roughly* compatible. Ideally, there would be a common task queue interface that supports a ` pop() `
58
61
method that would return a plain [ =task=] , but that would involve a fair amount of refactoring.
62
+
63
+ ### <a href =" https://html.spec.whatwg.org/multipage/webappapis.html#hostmakejobcallback " >HostMakeJobCallback(callable)</a > ### {#sec-patches-html-hostmakejobcallback}
64
+
65
+ Add the following before step 5:
66
+
67
+ 1 . Let |event loop| be <var ignore =' ' >incumbent settings<var >'s
68
+ [ =environment settings object/realm=] 's [ =realm/agent=] 's [ =agent/event loop=] .
69
+ 1 . Let |state| be |event loop|'s [ =event loop/current scheduling state=] .
70
+
71
+ Modify step 5 to read:
72
+
73
+ 1 . Return the <span >JobCallback Record</span > { \[ [ Callback]] : <var ignore =' ' >callable</var >,
74
+ \[ [ HostDefined]] : { \[ [ IncumbentSettings]] : <var ignore =' ' >incumbent settings</var >,
75
+ \[ [ ActiveScriptContext]] : <var ignore =' ' >script execution context</var >,
76
+ \[ [ SchedulingState]] : |state| } }.
77
+
78
+ ### <a href =" https://html.spec.whatwg.org/multipage/webappapis.html#hostcalljobcallback " >HostCallJobCallback(callback, V, argumentsList)</a > ### {#sec-patches-html-hostcalljobcallback}
79
+
80
+ Add the following steps before step 5:
81
+
82
+ 1 . Let |event loop| be <var ignore =' ' >incumbent settings<var >'s
83
+ [ =environment settings object/realm=] 's [ =realm/agent=] 's [ =agent/event loop=] .
84
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to
85
+ <var ignore =' ' >callback</var >.\[ [ HostDefined]] .\[ [ SchedulingState]] .
86
+
87
+ Add the following after step 7:
88
+
89
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to null.
90
+
91
+ ## <a href =" https://w3c.github.io/requestidlecallback/ " >` requestIdleCallback() ` </a > ## {#sec-patches-requestidlecallback}
92
+
93
+ ### <a href =" https://w3c.github.io/requestidlecallback/#invoke-idle-callbacks-algorithm " >Invoke idle callbacks algorithm</a > ### {#sec-patches-invoke-idle-callbacks}
94
+
95
+ Add the following step before step 3.3:
96
+
97
+ 1 . Let |realm| be the [ =relevant realm=] for <var ignore =' ' >window</var >.
98
+ 1 . Let |state| be a new [ =scheduling state=] .
99
+ 1 . Set |state|'s [ =scheduling state/priority source=] to the result of [ =creating a fixed priority
100
+ unabortable task signal=] given "{{TaskPriority/background}}" and |realm|.
101
+ 1 . Let |event loop| be |realm|'s [ =realm/agent=] 's [ =agent/event loop=] .
102
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to |state|.
103
+
104
+ Add the following after step 3.3:
105
+
106
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to null.
0 commit comments