Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / WebTaskScheduling.webidl
blob24659f30598b3a09968d28b1e42eb33982a6c456
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
5 enum TaskPriority {
6   "user-blocking",
7   "user-visible",
8   "background"
9 };
11 [Exposed=(Window, Worker), Pref="dom.enable_web_task_scheduling"]
12 interface TaskSignal : AbortSignal {
13   readonly attribute TaskPriority priority;
15   attribute EventHandler onprioritychange;
19 dictionary SchedulerPostTaskOptions {
20   AbortSignal signal;
21   TaskPriority priority;
22   [EnforceRange] unsigned long long delay = 0;
25 callback SchedulerPostTaskCallback = any ();
27 [Exposed=(Window, Worker), Pref="dom.enable_web_task_scheduling"]
28 interface Scheduler {
29   [UseCounter]
30   Promise<any> postTask(
31     SchedulerPostTaskCallback callback,
32     optional SchedulerPostTaskOptions options = {}
33   );
36 dictionary TaskControllerInit {
37   TaskPriority priority = "user-visible";
40 [Exposed=(Window,Worker), Pref="dom.enable_web_task_scheduling"]
41 interface TaskController : AbortController {
42   [Throws]
43   constructor(optional TaskControllerInit init = {});
45   [Throws]
46   undefined setPriority(TaskPriority priority);