mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Implement trusted types for setTimeout/setInterval (#38736)
I had a difficult time figuring out where the relevant steps had to be added. Therefore, I aggressively commented the spec steps so eventually I discovered where I should add them. Part of #36258 --------- Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
a31235e52b
commit
4de9a9d100
16 changed files with 149 additions and 120 deletions
|
@ -651,7 +651,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'Window': {
|
||||
'canGc': ['Stop', 'Fetch', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap', 'CreateImageBitmap_', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'canGc': ['Stop', 'Fetch', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap', 'CreateImageBitmap_', 'SetInterval', 'SetTimeout', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'inRealms': ['Fetch', 'GetOpener', 'WebdriverCallback', 'WebdriverException'],
|
||||
'additionalTraits': ['crate::interfaces::WindowHelpers'],
|
||||
},
|
||||
|
@ -663,7 +663,7 @@ DOMInterfaces = {
|
|||
|
||||
'WorkerGlobalScope': {
|
||||
'inRealms': ['Fetch'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'CreateImageBitmap_', 'ImportScripts', 'TrustedTypes'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'CreateImageBitmap_', 'ImportScripts', 'SetInterval', 'SetTimeout', 'TrustedTypes'],
|
||||
},
|
||||
|
||||
'Worklet': {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#windoworworkerglobalscope
|
||||
|
||||
typedef (DOMString or Function) TimerHandler;
|
||||
typedef (TrustedScript or DOMString or Function) TimerHandler;
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface mixin WindowOrWorkerGlobalScope {
|
||||
|
@ -15,9 +15,9 @@ interface mixin WindowOrWorkerGlobalScope {
|
|||
[Throws] DOMString atob(DOMString data);
|
||||
|
||||
// timers
|
||||
long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
[Throws] long setTimeout(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
undefined clearTimeout(optional long handle = 0);
|
||||
long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
[Throws] long setInterval(TimerHandler handler, optional long timeout = 0, any... arguments);
|
||||
undefined clearInterval(optional long handle = 0);
|
||||
|
||||
// microtask queuing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue