You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.bs
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,9 @@ While this term is intentionally broad to also encompass Web Browsers, the prima
33
33
Common API Index {#api-index}
34
34
=========================
35
35
36
-
All <a>Web-interoperable Runtimes</a> conforming to this specification MUST implement each of the following Web Platform APIs. These SHALL be implemented in accordance with their normative requirements except where modified here. Where any conforming runtime environment chooses (either by necessity or otherwise) to diverge from a normative requirement of the specification, clear explanations of such divergence MUST be made clearly and readily available in the documentation.
36
+
All <a>Web-interoperable Runtimes</a> conforming to this specification MUST implement each of the following Web Platform APIs. These SHOULD be implemented in accordance with their normative requirements except where modified here. Where any conforming runtime environment chooses (either by necessity or otherwise) to diverge from a normative requirement of the specification, clear explanations of such divergence MUST be made clearly and readily available in the documentation.
37
37
38
-
All of the following interfaces MUST be exposed on the global object accessible through `globalThis`:
38
+
All of the following interfaces MUST be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification:
39
39
40
40
* {{AbortController}}[[!DOM]]
41
41
* {{AbortSignal}}[[!DOM]]
@@ -91,11 +91,13 @@ All of the following interfaces MUST be exposed on the global object accessible
91
91
* {{WritableStreamDefaultController}}[[!STREAMS]]
92
92
* {{WritableStreamDefaultWriter}}[[!STREAMS]]
93
93
94
-
All of the following methods and properties MUST be exposed on the global object accessible through `globalThis`:
94
+
All of the following methods and properties MUST be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification:
95
95
96
96
* {{globalThis}}[[!ECMASCRIPT]]
97
97
* `globalThis.`{{atob()}}[[!HTML]]
98
98
* `globalThis.`{{btoa()}}[[!HTML]]
99
+
* `globalThis.`{{clearTimeout()}}[[!HTML]]
100
+
* `globalThis.`{{clearInterval()}}[[!HTML]]
99
101
* `globalThis.`{{console}}[[!CONSOLE]]
100
102
* `globalThis.`{{crypto}}[[!WEBCRYPTO]]
101
103
* `globalThis.`{{fetch()}}[[!FETCH]]
@@ -108,39 +110,37 @@ All of the following methods and properties MUST be exposed on the global object
108
110
* `globalThis.`{{reportError()}}[[!HTML]]
109
111
* `globalThis.`self (on {{Window/self|Window}} and {{WorkerGlobalScope/self|WorkerGlobalScope}}) [[!HTML]]
110
112
111
-
Note: This returns the value of `globalThis`.
112
-
113
113
Issue: When the <a href="https://github.com/whatwg/html/pull/9893">ShadowRealm integration PR</a>
114
114
is merged into the HTML spec,
115
115
`self` will also need to be exposed on `ShadowRealmGlobalScope`.
The exact type of the global scope (`globalThis`) can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{Worker}}, {{WorkerGlobalScope}}, and so forth. To simplify conformance, all interfaces, methods, and properties defined by this specification MUST be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc).
130
+
The exact type of the global scope (`globalThis`) can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{WorkerGlobalScope}}, and so forth. To simplify conformance, all interfaces, methods, and properties defined by this specification MUST be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc).
131
131
132
132
With many runtimes, adding a new global-scoped property can introduce breaking changes when the new global conflicts with existing application code. Many Web Platform APIs define global properties using [=read only|the `readonly` attribute=]. [[!WEBIDL]] To avoid introducing breaking changes, runtimes conforming to this specification MAY choose to ignore the `readonly` attribute for properties being added to the global scope. This allows users of these runtimes to delete or overwrite these properties if they conflict with existing application code.
133
133
134
134
The global object on {{Window}}-like and worker environments SHOULD always be an instance of {{EventTarget}}. Web-interoperable runtimes SHOULD follow the <a>report an exception</a> algorithm, and the JavaScript <a href="https://tc39.es/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</a> host hook, as defined in [[!HTML]]. This includes firing the {{Window/error}}, {{Window/unhandledrejection}} and {{Window/rejectionhandled}} events on the global object.
135
135
136
-
In cases where it is not possible to have the global object be an instance of {{EventTarget}} due to legacy reasons, the relevant events MUST still be fired through a suitable alternative mechanism available at the global scope. This mechanism MUST provide at least the same information that is provided by the relevant event interfaces if the global object were to be an {{EventTarget}}. Such runtimes MUST NOT support the {{GlobalEventHandlers/onerror}}, {{WindowEventHandlers/onunhandledrejection}} and {{WindowEventHandlers/onrejectionhandled}} global properties. Such runtimes NEED NOT implement the {{ErrorEvent}} and {{PromiseRejectionEvent}} interfaces.
136
+
In cases where it is not possible to have the global object be an instance of {{EventTarget}} due to legacy reasons, the relevant events MUST still be fired through a suitable alternative mechanism available at the global scope. This mechanism MUST provide at least the same information that is provided by the relevant event interfaces if the global object were to be an {{EventTarget}}. Such runtimes MUST NOT support the {{GlobalEventHandlers/onerror}}, {{WindowEventHandlers/onunhandledrejection}} and {{WindowEventHandlers/onrejectionhandled}} global properties. Such runtimes are not required to implement the {{ErrorEvent}} and {{PromiseRejectionEvent}} interfaces.
137
137
138
138
Note: For example, in Node.js the global object does not implement {{EventTarget}}, and the relevant events are fired on the `globalThis.process` object with the names `uncaughtException`, `unhandledRejection` and `rejectionHandled`, respectively.
139
139
140
140
Requirements for default User-Agent value {#useragent-requirements}
The [=default `User-Agent` value=] is provided such that application code can reliably identify the runtime within which it is running. The value MUST be a string conforming to the <code class="idl"><a data-link-type="idl" href="https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.3">`User-Agent`</a></code> construction in RFC 7231:
143
+
The [=default `User-Agent` value=] is provided such that application code can reliably identify the runtime within which it is running. The value MUST be a string conforming to the <code class="idl"><a data-link-type="idl" href="https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.3">`User-Agent`</a></code> construction in [[RFC7231]]:
0 commit comments