@@ -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,46 @@ 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 |state| be the [ =incumbent realm=] 's [ =realm/agent=] 's associated [ =event loop=] 's
68
+ [ =event loop/current scheduling state=] .
69
+
70
+ Modify step 5 to read:
71
+
72
+ 1 . Return the <span >JobCallback Record</span > { ` [[Callback]] ` : <var ignore =' ' >callable</var >,
73
+ ` [[HostDefined]] ` : { ` [[IncumbentSettings]] ` : <var ignore =' ' >incumbent settings</var >,
74
+ ` [[ActiveScriptContext]] ` : <var ignore =' ' >script execution context</var >,
75
+ ` [[SchedulingState]] ` : |state| } }.
76
+
77
+ ### <a href =" https://html.spec.whatwg.org/multipage/webappapis.html#hostcalljobcallback " >HostCallJobCallback(callback, V, argumentsList)</a > ### {#sec-patches-html-hostcalljobcallback}
78
+
79
+ Add the following steps before step 5:
80
+
81
+ 1 . Let |event loop| be the [ =incumbent realm=] 's [ =realm/agent=] 's associated [ =event loop=] .
82
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to
83
+ <var ignore =' ' >callback</var >.` [[HostDefined]] ` .` [[SchedulingState]] ` .
84
+
85
+ Add the following after step 7:
86
+
87
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to null.
88
+
89
+ ## <a href =" https://w3c.github.io/requestidlecallback/ " >` requestIdleCallback() ` </a > ## {#sec-patches-requestidlecallback}
90
+
91
+ ### <a href =" https://w3c.github.io/requestidlecallback/#invoke-idle-callbacks-algorithm " >Invoke idle callbacks algorithm</a > ### {#sec-patches-invoke-idle-callbacks}
92
+
93
+ Add the following step before step 3.3:
94
+
95
+ 1 . Let |realm| be <var ignore =' ' > window's [ =relevant realm=] .
96
+ 1 . Let |state| be a new [ =scheduling state=] .
97
+ 1 . Set |state|'s [ =scheduling state/priority source=] to the result of [ =creating a fixed priority
98
+ unabortable task signal=] given "{{TaskPriority/background}}" and |realm|.
99
+ 1 . Let |event loop| be |realm|'s [ =realm/agent=] 's associated [ =event loop=] .
100
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to |state|.
101
+
102
+ Add the following after step 3.3:
103
+
104
+ 1 . Set |event loop|'s [ =event loop/current scheduling state=] to null.
0 commit comments