mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
Update web-platform-tests to revision 60220357131c65146444da1f54624d5b54d0975d
This commit is contained in:
parent
c45192614c
commit
775b784f79
2144 changed files with 58115 additions and 29658 deletions
201
tests/wpt/web-platform-tests/interfaces/service-workers.idl
Normal file
201
tests/wpt/web-platform-tests/interfaces/service-workers.idl
Normal file
|
@ -0,0 +1,201 @@
|
|||
// GENERATED CONTENT - DO NOT EDIT
|
||||
// Content of this file was automatically extracted from the
|
||||
// "Service Workers 1" spec.
|
||||
// See: https://w3c.github.io/ServiceWorker/v1/
|
||||
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface ServiceWorker : EventTarget {
|
||||
readonly attribute USVString scriptURL;
|
||||
readonly attribute ServiceWorkerState state;
|
||||
void postMessage(any message, optional sequence<object> transfer = []);
|
||||
|
||||
// event
|
||||
attribute EventHandler onstatechange;
|
||||
};
|
||||
ServiceWorker implements AbstractWorker;
|
||||
|
||||
enum ServiceWorkerState {
|
||||
"installing",
|
||||
"installed",
|
||||
"activating",
|
||||
"activated",
|
||||
"redundant"
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface ServiceWorkerRegistration : EventTarget {
|
||||
readonly attribute ServiceWorker? installing;
|
||||
readonly attribute ServiceWorker? waiting;
|
||||
readonly attribute ServiceWorker? active;
|
||||
|
||||
readonly attribute USVString scope;
|
||||
readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
|
||||
|
||||
[NewObject] Promise<void> update();
|
||||
[NewObject] Promise<boolean> unregister();
|
||||
|
||||
// event
|
||||
attribute EventHandler onupdatefound;
|
||||
};
|
||||
|
||||
enum ServiceWorkerUpdateViaCache {
|
||||
"imports",
|
||||
"all",
|
||||
"none"
|
||||
};
|
||||
|
||||
partial interface Navigator {
|
||||
[SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
|
||||
};
|
||||
|
||||
partial interface WorkerNavigator {
|
||||
[SecureContext, SameObject] readonly attribute ServiceWorkerContainer serviceWorker;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface ServiceWorkerContainer : EventTarget {
|
||||
readonly attribute ServiceWorker? controller;
|
||||
readonly attribute Promise<ServiceWorkerRegistration> ready;
|
||||
|
||||
[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options);
|
||||
|
||||
[NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
|
||||
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
|
||||
|
||||
void startMessages();
|
||||
|
||||
// events
|
||||
attribute EventHandler oncontrollerchange;
|
||||
attribute EventHandler onmessage; // event.source of message events is ServiceWorker object
|
||||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
|
||||
dictionary RegistrationOptions {
|
||||
USVString scope;
|
||||
WorkerType type = "classic";
|
||||
ServiceWorkerUpdateViaCache updateViaCache = "imports";
|
||||
};
|
||||
|
||||
[Global=(Worker,ServiceWorker), Exposed=ServiceWorker]
|
||||
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
|
||||
[SameObject] readonly attribute Clients clients;
|
||||
[SameObject] readonly attribute ServiceWorkerRegistration registration;
|
||||
|
||||
[NewObject] Promise<void> skipWaiting();
|
||||
|
||||
attribute EventHandler oninstall;
|
||||
attribute EventHandler onactivate;
|
||||
attribute EventHandler onfetch;
|
||||
|
||||
// event
|
||||
attribute EventHandler onmessage; // event.source of the message events is Client object
|
||||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
|
||||
[Exposed=ServiceWorker]
|
||||
interface Client {
|
||||
readonly attribute USVString url;
|
||||
readonly attribute DOMString id;
|
||||
readonly attribute ClientType type;
|
||||
void postMessage(any message, optional sequence<object> transfer = []);
|
||||
};
|
||||
|
||||
[Exposed=ServiceWorker]
|
||||
interface WindowClient : Client {
|
||||
readonly attribute VisibilityState visibilityState;
|
||||
readonly attribute boolean focused;
|
||||
[SameObject] readonly attribute FrozenArray<USVString> ancestorOrigins;
|
||||
[NewObject] Promise<WindowClient> focus();
|
||||
[NewObject] Promise<WindowClient?> navigate(USVString url);
|
||||
};
|
||||
|
||||
[Exposed=ServiceWorker]
|
||||
interface Clients {
|
||||
// The objects returned will be new instances every time
|
||||
[NewObject] Promise<any> get(DOMString id);
|
||||
[NewObject] Promise<FrozenArray<Client>> matchAll(optional ClientQueryOptions options);
|
||||
[NewObject] Promise<WindowClient?> openWindow(USVString url);
|
||||
[NewObject] Promise<void> claim();
|
||||
};
|
||||
|
||||
dictionary ClientQueryOptions {
|
||||
boolean includeUncontrolled = false;
|
||||
ClientType type = "window";
|
||||
};
|
||||
|
||||
enum ClientType {
|
||||
"window",
|
||||
"worker",
|
||||
"sharedworker",
|
||||
"all"
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional ExtendableEventInit eventInitDict), Exposed=ServiceWorker]
|
||||
interface ExtendableEvent : Event {
|
||||
void waitUntil(Promise<any> f);
|
||||
};
|
||||
|
||||
dictionary ExtendableEventInit : EventInit {
|
||||
// Defined for the forward compatibility across the derived events
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, FetchEventInit eventInitDict), Exposed=ServiceWorker]
|
||||
interface FetchEvent : ExtendableEvent {
|
||||
[SameObject] readonly attribute Request request;
|
||||
readonly attribute DOMString clientId;
|
||||
|
||||
void respondWith(Promise<Response> r);
|
||||
};
|
||||
|
||||
dictionary FetchEventInit : ExtendableEventInit {
|
||||
required Request request;
|
||||
DOMString clientId = "";
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), Exposed=ServiceWorker]
|
||||
interface ExtendableMessageEvent : ExtendableEvent {
|
||||
readonly attribute any data;
|
||||
readonly attribute USVString origin;
|
||||
readonly attribute DOMString lastEventId;
|
||||
[SameObject] readonly attribute (Client or ServiceWorker or MessagePort)? source;
|
||||
readonly attribute FrozenArray<MessagePort> ports;
|
||||
};
|
||||
|
||||
dictionary ExtendableMessageEventInit : ExtendableEventInit {
|
||||
any data = null;
|
||||
USVString origin = "";
|
||||
DOMString lastEventId = "";
|
||||
(Client or ServiceWorker or MessagePort)? source = null;
|
||||
sequence<MessagePort> ports = [];
|
||||
};
|
||||
|
||||
partial interface WindowOrWorkerGlobalScope {
|
||||
[SecureContext, SameObject] readonly attribute CacheStorage caches;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface Cache {
|
||||
[NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
|
||||
[NewObject] Promise<FrozenArray<Response>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
|
||||
[NewObject] Promise<void> add(RequestInfo request);
|
||||
[NewObject] Promise<void> addAll(sequence<RequestInfo> requests);
|
||||
[NewObject] Promise<void> put(RequestInfo request, Response response);
|
||||
[NewObject] Promise<boolean> delete(RequestInfo request, optional CacheQueryOptions options);
|
||||
[NewObject] Promise<FrozenArray<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
|
||||
};
|
||||
|
||||
dictionary CacheQueryOptions {
|
||||
boolean ignoreSearch = false;
|
||||
boolean ignoreMethod = false;
|
||||
boolean ignoreVary = false;
|
||||
DOMString cacheName;
|
||||
};
|
||||
|
||||
[SecureContext, Exposed=(Window,Worker)]
|
||||
interface CacheStorage {
|
||||
[NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
|
||||
[NewObject] Promise<boolean> has(DOMString cacheName);
|
||||
[NewObject] Promise<Cache> open(DOMString cacheName);
|
||||
[NewObject] Promise<boolean> delete(DOMString cacheName);
|
||||
[NewObject] Promise<sequence<DOMString>> keys();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue