Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WindowOrWorkerGlobalScope mixin page #8796

Merged
merged 2 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7542,7 +7542,6 @@
/en-US/docs/Web/API/GlobalEventHandlers/onmozfullscreenchange /en-US/docs/Web/API/Document/onfullscreenchange
/en-US/docs/Web/API/GlobalEventHandlers/onmozfullscreenerror /en-US/docs/Web/API/Document/onfullscreenerror
/en-US/docs/Web/API/GlobalEventHandlers/onpointerdown/drag /en-US/docs/Web/API/GlobalEventHandlers/ondrag
/en-US/docs/Web/API/GlobalFetch /en-US/docs/Web/API/WindowOrWorkerGlobalScope
/en-US/docs/Web/API/GlobalFetch/GlobalFetch.fetch() /en-US/docs/Web/API/fetch
/en-US/docs/Web/API/GlobalFetch/fetch /en-US/docs/Web/API/fetch
/en-US/docs/Web/API/Guide/Events/Creating_and_triggering_events /en-US/docs/Web/Events/Creating_and_triggering_events
Expand Down Expand Up @@ -8918,7 +8917,6 @@
/en-US/docs/Web/API/Window/setInterval /en-US/docs/Web/API/setInterval
/en-US/docs/Web/API/Window/setTimeout /en-US/docs/Web/API/setTimeout
/en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages /en-US/docs/Web/OpenSearch
/en-US/docs/Web/API/WindowBase64 /en-US/docs/Web/API/WindowOrWorkerGlobalScope
/en-US/docs/Web/API/WindowBase64.atob /en-US/docs/Web/API/atob
/en-US/docs/Web/API/WindowBase64.btoa /en-US/docs/Web/API/btoa
/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding /en-US/docs/Glossary/Base64
Expand Down Expand Up @@ -8952,7 +8950,6 @@
/en-US/docs/Web/API/WindowOrWorkerGlobalScope/unhandledrejection_event /en-US/docs/Web/API/Window/unhandledrejection_event
/en-US/docs/Web/API/WindowSessionStorage /en-US/docs/Web/API/Window/sessionStorage
/en-US/docs/Web/API/WindowSessionStorage.sessionStorage /en-US/docs/Web/API/Window/sessionStorage
/en-US/docs/Web/API/WindowTimers /en-US/docs/Web/API/WindowOrWorkerGlobalScope
/en-US/docs/Web/API/WindowTimers.clearInterval /en-US/docs/Web/API/clearInterval
/en-US/docs/Web/API/WindowTimers.clearTimeout /en-US/docs/Web/API/clearTimeout
/en-US/docs/Web/API/WindowTimers.setInterval /en-US/docs/Web/API/setInterval
Expand Down
14 changes: 0 additions & 14 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -91547,20 +91547,6 @@
"alecananian"
]
},
"Web/API/WindowOrWorkerGlobalScope": {
"modified": "2020-10-15T21:51:33.987Z",
"contributors": [
"mfuji09",
"unarist",
"chrisdavidmills",
"Sheppy",
"zbjornson",
"sideshowbarker",
"fscholz",
"kenrick95",
"Bzbarsky"
]
},
"Web/API/Worker": {
"modified": "2020-10-15T21:10:11.615Z",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/mixin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<p>The advantage of mixins is that they can be used to simplify the design of APIs in which multiple interfaces need to include the same methods and properties.</p>

<p>For example, the {{domxref("WindowOrWorkerGlobalScope")}} mixin is used to provide methods and properties that need to be available on both the {{domxref("Window")}} and {{domxref("WorkerGlobalScope")}} interfaces. The mixin is implemented by both of those interfaces.</p>
<p>For example, the <code>WindowOrWorkerGlobalScope</code> mixin is used to provide methods and properties that need to be available on both the {{domxref("Window")}} and {{domxref("WorkerGlobalScope")}} interfaces. The mixin is implemented by both of those interfaces.</p>

<h2 id="Learn_more">Learn more</h2>

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/cache/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2 id="Examples">Examples</h2>

<p>The code snippet also shows a best practice for versioning caches used by the service worker. Though there's only one cache in this example, the same approach can be used for multiple caches. It maps a shorthand identifier for a cache to a specific, versioned cache name. The code also deletes all caches that aren't named in <code>CURRENT_CACHES</code>.</p>

<p>In the code example, <code>caches</code> is a property of the {{domxref("ServiceWorkerGlobalScope")}}. It holds the <code>CacheStorage</code> object, by which it can access the {{domxref("CacheStorage")}} interface. This is an implementation of the {{domxref("WindowOrWorkerGlobalScope")}} mixin.</p>
<p>In the code example, <code>caches</code> is a property of the {{domxref("ServiceWorkerGlobalScope")}}. It holds the <code>CacheStorage</code> object, by which it can access the {{domxref("CacheStorage")}} interface.</p>

<div class="notecard note">
<p><strong>Note:</strong> In Chrome, visit <code>chrome://inspect/#service-workers</code> and click on the "inspect" link below the registered service worker to view logging statements for the various actions the <code><a href="https://github.com/GoogleChrome/samples/blob/gh-pages/service-worker/selective-caching/service-worker.js">service-worker.js</a></code> script is performing.</p>
Expand Down Expand Up @@ -156,7 +156,7 @@ <h2 id="Examples">Examples</h2>

<h3 id="Storing_cookies_in_Caches">Storing cookies in Caches</h3>

<p>The <a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a> requires {{httpheader("Set-Cookie")}} headers to be stripped before returning a {{domxref("Response")}} object from {{domxref("WindowOrWorkerGlobalScope", "fetch()")}}. So a <code>Response</code> stored in a Cache won't contain headers.</p>
<p>The <a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a> requires {{httpheader("Set-Cookie")}} headers to be stripped before returning a {{domxref("Response")}} object from {{domxref("fetch()")}}. So a <code>Response</code> stored in a Cache won't contain headers.</p>

<h2 id="Specifications">Specifications</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<p>This event loop may be either the browser's main event loop or the event loop driving a <a href="/en-US/docs/Web/API/Web_Workers_API">web worker</a>. This lets the given function run without the risk of interfering with another script's execution, yet also ensures that the microtask runs before the user agent has the opportunity to react to actions taken by the microtask.</p>

<p>JavaScript <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</a> and the <a href="/en-US/docs/Web/API/MutationObserver">Mutation Observer API</a> both use the microtask queue to run their callbacks, but there are other times when the ability to defer work until the current event loop pass is wrapping up. In order to allow microtasks to be used by third-party libraries, frameworks, and polyfills, the {{domxref("queueMicrotask()")}} method is exposed on the {{domxref("Window")}} and {{domxref("Worker")}} interfaces through the {{domxref("WindowOrWorkerGlobalScope")}} mixin.</p>
<p>JavaScript <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promises</a> and the <a href="/en-US/docs/Web/API/MutationObserver">Mutation Observer API</a> both use the microtask queue to run their callbacks, but there are other times when the ability to defer work until the current event loop pass is wrapping up. In order to allow microtasks to be used by third-party libraries, frameworks, and polyfills, the {{domxref("queueMicrotask()")}} method is exposed on the {{domxref("Window")}} and {{domxref("Worker")}} interfaces.</p>

<h2 id="Tasks_vs_microtasks">Tasks vs microtasks</h2>

Expand Down
3 changes: 0 additions & 3 deletions files/en-us/web/api/queuemicrotask/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
<p>Microtasks are especially useful for libraries and frameworks that need to perform
final cleanup or other just-before-rendering tasks.</p>

<p><code>queueMicrotask()</code> is exposed on the
{{domxref("WindowOrWorkerGlobalScope")}} mixin.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">queueMicrotask(<em>function</em>);
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/serviceworkerglobalscope/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2 id="Methods">Methods</h2>
<dd>Allows the current service worker registration to progress from waiting to active state while service worker clients are using it.</dd>
</dl>

<p><code>ServiceWorkerGlobalScope</code> implements {{domxref("WorkerGlobalScope")}} — which implements {{domxref("WindowOrWorkerGlobalScope")}}. Therefore it also has the following property available to it:</p>
<p><code>ServiceWorkerGlobalScope</code> implements {{domxref("WorkerGlobalScope")}}. Therefore it also has the following property available to it:</p>

<dl>
<dt>{{domxref("fetch()")}}</dt>
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/web/api/settimeout/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,25 @@ <h2>Description</h2>

<h3 id="asynchronous">Working with asynchronous functions</h3>

<p><code>setTimeout()</code> is an asynchronous function, meaning that the timer function will not pause execution of other functions in the functions stack.
<p><code>setTimeout()</code> is an asynchronous function, meaning that the timer function will not pause execution of other functions in the functions stack.
In other words, you cannot use <code>setTimeout()</code> to create a "pause" before the next function in the function stack fires.</p>

<p>See the following example:</p>
<pre class="brush: js">
setTimeout(() => {console.log("this is the first message")}, 5000);
setTimeout(() => {console.log("this is the second message")}, 3000);
setTimeout(() => {console.log("this is the third message")}, 1000);
// Output:

// Output:

// this is the third message
// this is the second message
// this is the first message
</pre>

<p>Notice that the first function does not create a 5-second "pause" before calling the second function. Instead, the first function is called, but waits 5 seconds to
execute. While the first function is waiting to execute, the second function is called, and a 3-second wait is applied to the second function before it executes. Since neither
the first nor the second function's timers have completed, the third function is called and completes its execution first. Then the second follows. Then finally the first function
the first nor the second function's timers have completed, the third function is called and completes its execution first. Then the second follows. Then finally the first function
is executed after its timer finally completes.

<p>To create a progression in which one function only fires after the completion of another function, see the documentation on <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promises</a>.
Expand Down Expand Up @@ -185,7 +185,7 @@ <h3 id="Passing_string_literals">Passing string literals</h3>
}, 500);
</pre>

<p>A string passed to <code>{{domxref("WindowOrworkerGlobalScope.setTimeout","setTimeout()")}}</code> is evaluated in the global context, so local symbols in the context where <code>{{domxref("WindowOrworkerGlobalScope.setTimeout","setTimeout()")}}</code> was called will not be available when the string is evaluated as code.</p>
<p>A string passed to <code>{{domxref("setTimeout()")}}</code> is evaluated in the global context, so local symbols in the context where <code>{{domxref("setTimeout()")}}</code> was called will not be available when the string is evaluated as code.</p>

<h3 id="Reasons_for_delays">Reasons for delays longer than specified</h3>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

<h2 id="Worker_Contexts_Functions">Worker Contexts &amp; Functions</h2>

<p><strong>Workers run in a different global context than the current window!</strong> While  {{domxref("Window")}} is not directly available to workers, many of the same methods are defined in a shared mixin ({{domxref("WindowOrWorkerGlobalScope")}}), and made available to workers through their own {{domxref("WorkerGlobalScope")}}-derived contexts: </p>
<p><strong>Workers run in a different global context than the current window!</strong> While  {{domxref("Window")}} is not directly available to workers, many of the same methods are defined in a shared mixin (<code>WindowOrWorkerGlobalScope</code>), and made available to workers through their own {{domxref("WorkerGlobalScope")}}-derived contexts: </p>

<ul>
<li>{{domxref("DedicatedWorkerGlobalScope")}} for dedicated workers</li>
<li>{{domxref("SharedWorkerGlobalScope")}} for shared workers</li>
<li>{{domxref("ServiceWorkerGlobalScope")}} for <a href="/en-US/docs/Web/API/ServiceWorker_API">service workers</a></li>
</ul>

<p>Some of the functions that are common to all workers and to the main thread (from {{domxref("WindowOrWorkerGlobalScope")}}) are: {{domxref("atob", "atob()")}}, {{domxref("btoa", "btoa()")}}, {{domxref("clearInterval", "clearInterval()")}}, {{domxref("clearTimeout()")}},{{domxref("Window.dump()", "dump()")}} {{non-standard_inline}}, {{domxref("setInterval()")}}, {{domxref("setTimeout()")}}.</p>
<p>Some of the functions that are common to all workers and to the main thread (from <code>WindowOrWorkerGlobalScope</code>) are: {{domxref("atob", "atob()")}}, {{domxref("btoa", "btoa()")}}, {{domxref("clearInterval", "clearInterval()")}}, {{domxref("clearTimeout()")}},{{domxref("Window.dump()", "dump()")}} {{non-standard_inline}}, {{domxref("setInterval()")}}, {{domxref("setTimeout()")}}.</p>

<p>The following functions are <strong>only</strong> available to workers:</p>

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/web_workers_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ <h3 id="Worker_types">Worker types</h3>

<h3 id="Worker_global_contexts_and_functions">Worker global contexts and functions</h3>

<p>Workers run in a different global context than the current {{DOMxRef("window")}}! While  {{domxref("Window")}} is not directly available to workers, many of the same methods are defined in a shared mixin ({{domxref("WindowOrWorkerGlobalScope")}}), and made available to workers through their own {{domxref("WorkerGlobalScope")}}-derived contexts: </p>
<p>Workers run in a different global context than the current {{DOMxRef("window")}}! While  {{domxref("Window")}} is not directly available to workers, many of the same methods are defined in a shared mixin (<code>WindowOrWorkerGlobalScope</code>), and made available to workers through their own {{domxref("WorkerGlobalScope")}}-derived contexts: </p>

<ul>
<li>{{domxref("DedicatedWorkerGlobalScope")}} for dedicated workers</li>
<li>{{domxref("SharedWorkerGlobalScope")}} for shared workers</li>
<li>{{domxref("ServiceWorkerGlobalScope")}} for <a href="/en-US/docs/Web/API/Service_Worker_API">service workers</a></li>
</ul>

<p>Some of the functions (a subset) that are common to all workers and to the main thread (from {{domxref("WindowOrWorkerGlobalScope")}}) are: {{domxref("atob", "atob()")}}, {{domxref("btoa", "btoa()")}}, {{domxref("clearInterval", "clearInterval()")}}, {{domxref("clearTimeout()")}},{{domxref("Window.dump()", "dump()")}} {{non-standard_inline}}, {{domxref("setInterval()")}}, {{domxref("setTimeout()")}}.</p>
<p>Some of the functions (a subset) that are common to all workers and to the main thread (from <code>WindowOrWorkerGlobalScope</code>) are: {{domxref("atob", "atob()")}}, {{domxref("btoa", "btoa()")}}, {{domxref("clearInterval", "clearInterval()")}}, {{domxref("clearTimeout()")}},{{domxref("Window.dump()", "dump()")}} {{non-standard_inline}}, {{domxref("setInterval()")}}, {{domxref("setTimeout()")}}.</p>

<p>The following functions are <strong>only</strong> available to workers:</p>

Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/window/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 id="Constructors">Constructors</h2>

<h2 id="Properties">Properties</h2>

<p><em>This interface inherits properties from the {{domxref("EventTarget")}} interface and implements properties from the {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("WindowEventHandlers")}} mixins.</em></p>
<p><em>This interface inherits properties from the {{domxref("EventTarget")}} interface and implements properties from the <code>WindowOrWorkerGlobalScope</code> and {{domxref("WindowEventHandlers")}} mixins.</em></p>

<p>Note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are listed in a separate section below.</p>

Expand Down Expand Up @@ -183,7 +183,7 @@ <h3 id="Properties_implemented_from_elsewhere">Properties implemented from elsew
<dd>Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an {{domxref("IDBFactory")}} object.</dd>
<dt>{{domxref("isSecureContext")}} {{readOnlyinline}}</dt>
<dd>Returns a boolean indicating whether the current context is secure (<code>true</code>) or not (<code>false</code>).</dd>
<dt>{{domxref("WindowOrWorkerGlobalScope.origin")}} {{readOnlyinline}}</dt>
<dt>{{domxref("origin")}} {{readOnlyinline}}</dt>
<dd>Returns the global object's origin, serialized as a string. (This does not yet appear to be implemented in any browser.)</dd>
</dl>

Expand All @@ -210,7 +210,7 @@ <h3 id="Deprecated_properties">Deprecated properties</h3>

<h2 id="Methods">Methods</h2>

<p><em>This interface inherits methods from the {{domxref("EventTarget")}} interface and implements methods from {{domxref("WindowOrWorkerGlobalScope")}} and {{domxref("EventTarget")}}.</em></p>
<p><em>This interface inherits methods from the {{domxref("EventTarget")}} interface and implements methods from <code>WindowOrWorkerGlobalScope</code> and {{domxref("EventTarget")}}.</em></p>

<dl>
<dt>{{domxref("Window.alert()")}}</dt>
Expand Down
Loading