Implemented Houdini worklets.

This commit is contained in:
Alan Jeffrey 2017-04-03 14:35:57 -05:00
parent abb2985ffe
commit af8436c9be
34 changed files with 1209 additions and 17 deletions

View file

@ -10,7 +10,7 @@
*/
[ClassString="Console",
Exposed=(Window,Worker),
Exposed=(Window,Worker,Worklet),
ProtoObjectHack]
namespace console {
// These should be DOMString message, DOMString message2, ...

View file

@ -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,

View file

@ -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 {};

View 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);
};

View 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);
};

View 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 ();

View file

@ -201,3 +201,4 @@ partial interface Window {
readonly attribute TestRunner testRunner;
//readonly attribute EventSender eventSender;
};

View 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";
};

View 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 {
};