diff --git a/docs/v1/index.bs b/docs/v1/index.bs index 285c27c9..67f40d1d 100644 --- a/docs/v1/index.bs +++ b/docs/v1/index.bs @@ -40,76 +40,16 @@ Markup Shorthands: css no
-spec: dom - type: dfn - text: invoke - type: interface - text: Document - text: Event - text: EventTarget - -spec: html; type: dfn - text: a browsing context is discarded - text: about:blank - text: active document - text: api base url - text: api url character encoding - text: application cache - text: auxiliary browsing context - text: browsing context - text: discard a document - text: environment settings object - text: event handler - text: event handler event type - text: event handler idl attributes - text: event loop - text: exceptions enabled flag - text: focusing steps - text: global object - text: incumbent settings object - text: in parallel - text: kill a worker - text: list of active timers - text: navigate - text: nested browsing context - text: neutered - text: parent browsing context - text: queue a task - text: relevant settings object - text: replacement enabled - text: responsible browsing context - text: responsible document - text: responsible event loop - text: same origin - text: script - text: settings object - text: source browsing context - text: structured clone - text: task sources - text: tasks - text: the worker's documents - text: top-level browsing context - text: triggered by user activation - text: trusted event - text: Unicode serialization of an origin - text: unload a document - text: user interaction task source - text: utf-8 decode - -spec: url; type: dfn - text: is local - -spec: webidl; type: dfn; - text: exception - text: partial interface - text: present +spec: dom; type: interface; text: Document +spec: html; type: element; text: link +spec: url; type: dfn; text: is local
spec: dom-ls; urlPrefix: https://dom.spec.whatwg.org/ type: dfn; text: ASCII case-insensitive; url: ascii-case-insensitive -spec: ecma-262; urlPrefix: http://www.ecma-international.org/ecma-262/6.0/ +spec: ecma-262; urlPrefix: http://tc39.github.io/ecma262/ type: dfn text: Assert; url: sec-algorithm-conventions text: [[Call]]; url: sec-ecmascript-function-objects-call-thisargument-argumentslist @@ -201,44 +141,16 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/ type: dfn urlPrefix: browsers.html text: origin; for: resource; url: origin-2 - urlPrefix: infrastructure.html - text: StructuredCloneWithTransfer urlPrefix: interaction.html text: has focus steps urlPrefix: webappapis.html - text: classic script - text: creation url text: dom manipulation task source - text: fetch a classic worker script - text: fetch a module worker script tree - text: fire a simple event - text: https state; for: environment settings object - text: module script - text: realm execution context - text: referrer policy; for: environment settings object; url: concept-settings-object-referrer-policy - text: relevant Realm; url: concept-relevant-realm - text: relevant global object; url: concept-relevant-global - text: report the error text: run a classic script text: run a module script - text: script; url: concept-script text: task queue; for: event loop - text: the global object's Realm; url: concept-global-object-realm - text: the Realm's global object; url: concept-realm-global urlPrefix: workers.html - text: get a fetch result - text: import scripts into worker global scope - text: postprocess the fetch result - text: runtime script errors handling; url: runtime-script-errors-2 text: shared workers - text: terminate a worker - text: validate the state text: web worker; url: workers - for: workerglobalscope; urlPrefix: #concept-workerglobalscope- - text: https state - text: referrer policy - text: type - text: url type: event urlPrefix: indices.html text: DOMContentLoaded; for: Document; url: event-domcontentloaded @@ -276,18 +188,6 @@ spec: url; urlPrefix: https://url.spec.whatwg.org/ type: dfn text: parsing; for: url; url: concept-url-parser text: serialized; for: url; url: concept-url-serializer - -spec: webidl; urlPrefix: https://heycam.github.io/webidl/ - type: dfn - text: throw; url: dfn-throw - type: exception - text: DataCloneError - text: InvalidAccessError - text: InvalidStateError - text: NetworkError - text: NotFoundError - text: QuotaExceededError - text: SecurityError
A service worker registration has an associated active worker (a service worker or null) whose state is either activating or activated. It is initially set to null.
A service worker registration has an associated last update check time. It is initially set to null.
A service worker registration has an associated uninstalling flag. It is initially unset.
-A service worker registration has one or more task queues that back up the tasks from its active worker's event loop's corresponding task queues. (The target task sources for this back up operation are the handle fetch task source and the handle functional event task source.) The user agent dumps the active worker's tasks to the service worker registration's task queues when the active worker is terminated and re-queues those tasks to the active worker's event loop's corresponding task queues when the active worker spins off. Unlike the task queues owned by event loops, the service worker registration's task queues are not processed by any event loops in and of itself.
+A service worker registration has one or more task queues that back up the tasks from its active worker's event loop's corresponding task queues. (The target task sources for this back up operation are the handle fetch task source and the handle functional event task source.) The user agent dumps the active worker's tasks to the service worker registration's task queues when the active worker is terminated and re-queues those tasks to the active worker's event loop's corresponding task queues when the active worker spins off. Unlike the task queues owned by event loops, the service worker registration's task queues are not processed by any event loops in and of itself.
auxiliary
"
- The window client's global object's browsing context is an auxiliary browsing context.
The window client's global object's browsing context is an auxiliary browsing context.
top-level
"
- The window client's global object's browsing context is a top-level browsing context.
The window client's global object's browsing context is a top-level browsing context.
nested
"
- The window client's global object's browsing context is a nested browsing context.
The window client's global object's browsing context is a nested browsing context.
none
"TypeError
and abort these steps.window
", and client is a window client, then:
updatefound
at all the {{ServiceWorkerRegistration}} objects for all the service worker clients whose creation url matches registration's scope url and all the service workers whose containing service worker registration is registration.updatefound
at all the {{ServiceWorkerRegistration}} objects for all the service worker clients whose creation url matches registration's scope url and all the service workers whose containing service worker registration is registration.install
, which does not bubble and is not cancelable.install
, which does not bubble and is not cancelable.activate
, which does not bubble and is not cancelable.activate
, which does not bubble and is not cancelable.In addition to the usual possibilities of returning a value or failing due to an exception, this could be prematurely aborted by the kill a worker or terminate a worker algorithms.
This effectively means that the fetch events and the other functional events such as push events are backed up by the registration's task queues while the other tasks including message events are discarded.
fetch
, which does not bubble.fetch
, which does not bubble.true
if request's client is a window client and the event was dispatched with the user's intention for the page reload, and false
otherwise.A new service worker is replacing the current service worker, or the current service worker is being discarded due to an install failure.
statechange
at workerObject.statechange
at workerObject.controllerchange
at the ServiceWorkerContainer
object client is associated with.controllerchange
at the ServiceWorkerContainer
object client is associated with.The task must use client's responsible event loop and the DOM manipulation task source.
A service worker is dispatched a set of lifecycle events, install and activate, and functional events including fetch.
A service worker has an associated script resource (a script), which represents its own script resource. It is initially set to null. A script resource has an associated has ever been evaluated flag. It is initially unset. A script resource has an associated HTTPS state (an HTTPS state value). It is initially "none
". A script resource has an associated referrer policy (a referrer policy). It is initially the empty string.
A service worker has an associated script resource map which is a List of the Record {[[key]], [[value]]} where [[key]] is a URL and [[value]] is a response.
+A service worker has an associated script resource map which is a List of the Record {[[key]], [[value]]} where [[key]] is a URL and [[value]] is a response.
A service worker has an associated skip waiting flag. Unless stated otherwise it is unset.
A service worker has an associated imported scripts updated flag. It is initially unset.
A service worker has an associated set of event types to handle whose element type is an event listener’s event type. It is initially set to null.
@@ -1757,7 +1757,7 @@A service worker registration has an associated last update check time. It is initially set to null.
A service worker registration has an associated uninstalling flag. It is initially unset.
-A service worker registration has one or more task queues that back up the tasks from its active worker’s event loop’s corresponding task queues. (The target task sources for this back up operation are the handle fetch task source and the handle functional event task source.) The user agent dumps the active worker’s tasks to the service worker registration’s task queues when the active worker is terminated and re-queues those tasks to the active worker’s event loop’s corresponding task queues when the active worker spins off. Unlike the task queues owned by event loops, the service worker registration’s task queues are not processed by any event loops in and of itself.
+A service worker registration has one or more task queues that back up the tasks from its active worker’s event loop’s corresponding task queues. (The target task sources for this back up operation are the handle fetch task source and the handle functional event task source.) The user agent dumps the active worker’s tasks to the service worker registration’s task queues when the active worker is terminated and re-queues those tasks to the active worker’s event loop’s corresponding task queues when the active worker spins off. Unlike the task queues owned by event loops, the service worker registration’s task queues are not processed by any event loops in and of itself.
A user agent must persistently keep a list of registered service worker registrations unless otherwise they are explicitly unregistered. A user agent has a scope to registration map that stores the entries of the tuple of service worker registration’s scope url and the corresponding service worker registration. The lifetime of service worker registrations is beyond that of the ServiceWorkerRegistration
objects which represent them within the lifetime of their corresponding service worker clients.
ServiceWorkerGlobalScope
object associated with serviceWorker.
MessagePort
objects in cloneRecord.[[TransferList]], if any, maintaining their relative order.
update()
update()
method must run these steps:
InvalidStateError
" exception and abort these steps.
@@ -1962,7 +1962,7 @@ unregister()
method unregisters the service worker registration. It is important to note that the currently controlled service worker client’s active worker’s containing service worker registration is effective until all the service worker clients (including itself) using this service worker registration unload. That is, the unregister()
method only affects subsequent navigations.
unregister()
method must run these steps:
ServiceWorkerContainer
object when a Navigator
object or a WorkerNavigator
object is created and associate it with that object.
A ServiceWorkerContainer
provides capabilities to register, unregister, and update the service worker registrations, and provides access to the state of the service worker registrations and their associated service workers.
A ServiceWorkerContainer
has an associated service worker client, which is a service worker client whose global object is associated with the Navigator
object or the WorkerNavigator
object that the ServiceWorkerContainer
is retrieved from.
A ServiceWorkerContainer
object has an associated ready promise (a promise). It is initially set to a new promise.
A ServiceWorkerContainer
object has an associated ready promise (a promise). It is initially set to a new promise.
A ServiceWorkerContainer
object has a task source called the client message queue, initially empty. A client message queue can be enabled or disabled, and is initially disabled. When a ServiceWorkerContainer
object’s client message queue is enabled, the event loop must use it as one of its task sources. When the ServiceWorkerContainer
object’s relevant global object is a Window
object, all tasks queued on its client message queue must be associated with its relevant settings object’s responsible document.
controller
When the ready
attribute is accessed, the returned promise will never reject. Instead, it waits until the promise resolves with a service worker registration that has an active worker.
When the ready
attribute is accessed, the returned promise will never reject. Instead, it waits until the promise resolves with a service worker registration that has an active worker.
register(scriptURL, options)
The register(scriptURL, options)
method creates or updates a service worker registration for the given scope url. If successful, a service worker registration ties the provided scriptURL to a scope url, which is subsequently used for navigation matching.
register(scriptURL, options)
method must run these steps:
TypeError
and abort these steps.
@@ -2095,9 +2095,9 @@ TypeError
.
+ TypeError
.
SecurityError
" exception.
- getRegistrations()
method must run these steps:
ServiceWorkerRegistration
object associated with entry.[[value]] to the array.
skipWaiting()
method allows this service worker to progress from the registration’s waiting position to active even while service worker clients are using the registration.
skipWaiting()
method must run these steps:
ServiceWorkerContainer
object whose service worker client is the context object’s service worker client.
InvalidStateError
" exception.
MessagePort
objects in cloneRecord.[[TransferList]], if any, maintaining their relative order.
focus()
The focus()
method must run these steps:
InvalidAccessError
" exception.
- InvalidAccessError
" exception.
+ navigate()
method must run these steps:
TypeError
.
- about:blank
, return a promise rejected with a TypeError
.
- TypeError
.
- TypeError
.
+ about:blank
, return a promise rejected with a TypeError
.
+ TypeError
.
+ get(id)
The get(id)
method must run these steps:
matchAll(options)
The matchAll(options)
method must run these steps:
openWindow(url)
method must run these steps:
TypeError
.
- about:blank
, return a promise rejected with a TypeError
.
- InvalidAccessError
" exception.
- TypeError
.
+ about:blank
, return a promise rejected with a TypeError
.
+ InvalidAccessError
" exception.
+ claim()
The claim()
method must run these steps:
InvalidStateError
" exception.
- InvalidStateError
" exception.
+ An ExtendableEvent
object has an associated extend lifetime promises (an array of promises). It is initially an empty array.
An ExtendableEvent
object has an associated extensions allowed flag. It is initially set.
Service workers have two lifecycle events, install
and activate
. Service workers use the ExtendableEvent
interface for activate
event and install
event.
Service worker extensions that define event handlers may also use or extend the ExtendableEvent
interface.
Service workers and extensions that define event handlers may define their own behaviors, allowing the extend lifetime promises to suggest operation length, and the rejected state of any of the promise in extend lifetime promises to suggest operation failure.
+Service workers and extensions that define event handlers may define their own behaviors, allowing the extend lifetime promises to suggest operation length, and the rejected state of any of the promise in extend lifetime promises to suggest operation failure.
Service workers define the following behaviors for install
event and activate
event, respectively:
ServiceWorkerGlobalScope
object that represents the service worker until it upgrades database schemas and deletes the outdated cache entries.
+ ServiceWorkerGlobalScope
object that represents the service worker until it upgrades database schemas and deletes the outdated cache entries.
event.respondWith(r)
Developers can set the argument r with either a promise that resolves with a Response
object or a Response
object (which is automatically cast to a promise). Otherwise, a network error is returned to Fetch. Renderer-side security checks about tainting for cross-origin content are tied to the types of filtered responses defined in Fetch.
Developers can set the argument r with either a promise that resolves with a Response
object or a Response
object (which is automatically cast to a promise). Otherwise, a network error is returned to Fetch. Renderer-side security checks about tainting for cross-origin content are tied to the types of filtered responses defined in Fetch.
respondWith(r)
method must run these steps:
The following definitions are the user agent’s internal data structures used throughout the specification.
-A scope to registration map is a List of the Record {[[key]], [[value]]} where [[key]] is a string that represents a scope url and [[value]] is a service worker registration.
+A scope to registration map is a List of the Record {[[key]], [[value]]} where [[key]] is a string that represents a scope url and [[value]] is a service worker registration.
A job is an abstraction of one of register, update, and unregister request for a service worker registration.
A job has a job type, which is one of register, update, and unregister.
A job has a scope url (a URL).
A job has a script url (a URL).
A job has a worker type ("classic
" or "module
").
A job has a client (a service worker client). It is initially null.
-A job has a promise (a promise). It is initially null.
+A job has a promise (a promise). It is initially null.
A job has a list of equivalent jobs (a list of jobs). It is initially the empty list.
A job has a force bypass cache flag It is initially unset.
Two jobs are equivalent when their job type is the same and:
@@ -3714,7 +3714,7 @@installing
" and worker as the arguments.
ServiceWorkerRegistration
object which represents registration.
- updatefound
at all the ServiceWorkerRegistration
objects for all the service worker clients whose creation url matches registration’s scope url and all the service workers whose containing service worker registration is registration.
+ updatefound
at all the ServiceWorkerRegistration
objects for all the service worker clients whose creation url matches registration’s scope url and all the service workers whose containing service worker registration is registration.
ExtendableEvent
interface, with the event type install
, which does not bubble and is not cancelable.
+ ExtendableEvent
interface, with the event type install
, which does not bubble and is not cancelable.
ExtendableEvent
interface, with the event type activate
, which does not bubble and is not cancelable.
+ ExtendableEvent
interface, with the event type activate
, which does not bubble and is not cancelable.
WorkerLocation
object and associate it with workerGlobalScope.
- In addition to the usual possibilities of returning a value or failing due to an exception, this could be prematurely aborted by the kill a worker or terminate a worker algorithms.
@@ -4215,7 +4215,7 @@This effectively means that the fetch events and the other functional events such as push events are backed up by the registration’s task queues while the other tasks including message events are discarded.
FetchEvent
interface, with the event type fetch
, which does not bubble.
+ FetchEvent
interface, with the event type fetch
, which does not bubble.
true
if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false
otherwise.
@@ -4321,8 +4321,8 @@ active
" and null as the arguments.
installing
"
- The service worker in this state is considered an installing worker. During this state, event.waitUntil(f)
can be called inside the oninstall
event handler to extend the life of the installing worker until the passed promise resolves successfully. This is primarily used to ensure that the service worker is not active until all of the core caches are populated.
The service worker in this state is considered an installing worker. During this state, event.waitUntil(f)
can be called inside the oninstall
event handler to extend the life of the installing worker until the passed promise resolves successfully. This is primarily used to ensure that the service worker is not active until all of the core caches are populated.
installed
"
@@ -4545,7 +4545,7 @@ activating
"
- The service worker in this state is considered an active worker. During this state, event.waitUntil(f)
can be called inside the onactivate
event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.
The service worker in this state is considered an active worker. During this state, event.waitUntil(f)
can be called inside the onactivate
event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.
activated
"
@@ -4555,7 +4555,7 @@ redundant
"
A new service worker is replacing the current service worker, or the current service worker is being discarded due to an install failure.
-statechange
at workerObject.
+ statechange
at workerObject.
The task must use workerObject’s relevant settings object’s responsible event loop and the DOM manipulation task source.
@@ -4570,8 +4570,8 @@controllerchange
at the ServiceWorkerContainer
object client is associated with.
+ controllerchange
at the ServiceWorkerContainer
object client is associated with.
The task must use client’s responsible event loop and the DOM manipulation task source.
@@ -4611,7 +4611,7 @@Response
objects.
+ Response
objects.