mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implemented Houdini worklets.
This commit is contained in:
parent
abb2985ffe
commit
af8436c9be
34 changed files with 1209 additions and 17 deletions
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
[ClassString="Console",
|
||||
Exposed=(Window,Worker),
|
||||
Exposed=(Window,Worker,Worklet),
|
||||
ProtoObjectHack]
|
||||
namespace console {
|
||||
// These should be DOMString message, DOMString message2, ...
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* https://dom.spec.whatwg.org/#interface-eventtarget
|
||||
*/
|
||||
|
||||
[Abstract, Exposed=(Window,Worker)]
|
||||
[Abstract, Exposed=(Window,Worker,Worklet)]
|
||||
interface EventTarget {
|
||||
void addEventListener(DOMString type,
|
||||
EventListener? listener,
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
// This interface is entirely internal to Servo, and should not be accessible to
|
||||
// web pages.
|
||||
|
||||
[Exposed=(Window,Worker),
|
||||
[Exposed=(Window,Worker,Worklet),
|
||||
Inline]
|
||||
interface GlobalScope : EventTarget {};
|
||||
|
|
12
components/script/dom/webidls/TestWorklet.webidl
Normal file
12
components/script/dom/webidls/TestWorklet.webidl
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// This interface is entirely internal to Servo, and should not be accessible to
|
||||
// web pages.
|
||||
|
||||
[Pref="dom.worklet.testing.enabled", Exposed=(Window), Constructor]
|
||||
interface TestWorklet {
|
||||
[NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options);
|
||||
DOMString? lookup(DOMString key);
|
||||
};
|
11
components/script/dom/webidls/TestWorkletGlobalScope.webidl
Normal file
11
components/script/dom/webidls/TestWorkletGlobalScope.webidl
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// This interface is entirely internal to Servo, and should not be accessible to
|
||||
// web pages.
|
||||
|
||||
[Global=(Worklet,TestWorklet), Exposed=TestWorklet]
|
||||
interface TestWorkletGlobalScope : WorkletGlobalScope {
|
||||
void registerKeyValue(DOMString key, DOMString value);
|
||||
};
|
13
components/script/dom/webidls/VoidFunction.webidl
Normal file
13
components/script/dom/webidls/VoidFunction.webidl
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/*
|
||||
* The origin of this IDL file is
|
||||
* https://heycam.github.io/webidl/#VoidFunction
|
||||
*
|
||||
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
||||
* Opera Software ASA. You are granted a license to use, reproduce
|
||||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
callback VoidFunction = void ();
|
|
@ -201,3 +201,4 @@ partial interface Window {
|
|||
readonly attribute TestRunner testRunner;
|
||||
//readonly attribute EventSender eventSender;
|
||||
};
|
||||
|
||||
|
|
13
components/script/dom/webidls/Worklet.webidl
Normal file
13
components/script/dom/webidls/Worklet.webidl
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://drafts.css-houdini.org/worklets/#worklet
|
||||
[Exposed=(Window)]
|
||||
interface Worklet {
|
||||
[NewObject] Promise<void> addModule(USVString moduleURL, optional WorkletOptions options);
|
||||
};
|
||||
|
||||
dictionary WorkletOptions {
|
||||
RequestCredentials credentials = "omit";
|
||||
};
|
10
components/script/dom/webidls/WorkletGlobalScope.webidl
Normal file
10
components/script/dom/webidls/WorkletGlobalScope.webidl
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://drafts.css-houdini.org/worklets/#workletglobalscope
|
||||
// TODO: The spec IDL doesn't make this a subclass of EventTarget
|
||||
// https://github.com/whatwg/html/issues/2611
|
||||
[Exposed=Worklet]
|
||||
interface WorkletGlobalScope: GlobalScope {
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue