Skip to content

Commit ca02d77

Browse files
authored
One more round of changes (#100)
1 parent 132f1ea commit ca02d77

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

index.bs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ While this term is intentionally broad to also encompass Web Browsers, the prima
3333
Common API Index {#api-index}
3434
=========================
3535

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.
3737

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:
3939

4040
* {{AbortController}} [[!DOM]]
4141
* {{AbortSignal}} [[!DOM]]
@@ -91,11 +91,13 @@ All of the following interfaces MUST be exposed on the global object accessible
9191
* {{WritableStreamDefaultController}} [[!STREAMS]]
9292
* {{WritableStreamDefaultWriter}} [[!STREAMS]]
9393

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:
9595

9696
* {{globalThis}} [[!ECMASCRIPT]]
9797
* `globalThis.`{{atob()}} [[!HTML]]
9898
* `globalThis.`{{btoa()}} [[!HTML]]
99+
* `globalThis.`{{clearTimeout()}} [[!HTML]]
100+
* `globalThis.`{{clearInterval()}} [[!HTML]]
99101
* `globalThis.`{{console}} [[!CONSOLE]]
100102
* `globalThis.`{{crypto}} [[!WEBCRYPTO]]
101103
* `globalThis.`{{fetch()}} [[!FETCH]]
@@ -108,39 +110,37 @@ All of the following methods and properties MUST be exposed on the global object
108110
* `globalThis.`{{reportError()}} [[!HTML]]
109111
* `globalThis.`self (on {{Window/self|Window}} and {{WorkerGlobalScope/self|WorkerGlobalScope}}) [[!HTML]]
110112

111-
Note: This returns the value of `globalThis`.
112-
113113
Issue: When the <a href="https://github.com/whatwg/html/pull/9893">ShadowRealm integration PR</a>
114114
is merged into the HTML spec,
115115
`self` will also need to be exposed on `ShadowRealmGlobalScope`.
116116

117-
* `globalThis.`{{setTimeout()}} / globalThis.{{clearTimeout()}} [[!HTML]]
118-
* `globalThis.`{{setInterval()}} / globalThis.{{clearInterval()}} [[!HTML]]
117+
* `globalThis.`{{setTimeout()}} [[!HTML]]
118+
* `globalThis.`{{setInterval()}} [[!HTML]]
119119
* `globalThis.`{{structuredClone()}} [[!HTML]]
120120
* `globalThis.`{{WebAssembly}}.{{WebAssembly/compile()}} [[!WASM-JS-API-2]]
121121
* `globalThis.`{{WebAssembly}}.{{WebAssembly/compileStreaming()}} [[!WASM-WEB-API-2]]
122122
* `globalThis.`{{WebAssembly}}.{{WebAssembly/instantiate()}} [[!WASM-JS-API-2]]
123123
* `globalThis.`{{WebAssembly}}.{{WebAssembly/instantiateStreaming()}} [[!WASM-WEB-API-2]]
124-
* `globalThis.`{{WebAssembly}}.{{WebAssembly/validate()}} [[!WASM-JS-API-2]]
125124
* `globalThis.`{{WebAssembly}}.{{WebAssembly/JSTag}} [[!WASM-JS-API-2]]
125+
* `globalThis.`{{WebAssembly}}.{{WebAssembly/validate()}} [[!WASM-JS-API-2]]
126126

127127
The Global Scope {#global-scope}
128128
================================
129129

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}}, {{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).
131131

132132
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.
133133

134134
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.
135135

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.
137137

138138
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.
139139

140140
Requirements for default User-Agent value {#useragent-requirements}
141141
========================================================================
142142

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 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]]:
144144

145145
<pre>
146146
User-Agent = product *( RWS ( product / comment ) )

0 commit comments

Comments
 (0)