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

Add storage key to environment. (whatwg/storage#142) #7940

Closed
wants to merge 1 commit into from
Closed
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
37 changes: 32 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -4235,9 +4235,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<p>The following terms are defined in <cite>Storage</cite>: <ref spec=STORAGE></p>

<ul class="brief">
<li><dfn data-x-href="https://storage.spec.whatwg.org/#compute-a-storage-key-for-an-environment">compute a storage key for an environment</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#compute-a-storage-key-for-an-environment-settings-object">compute a storage key for an environment settings object</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#obtain-a-local-storage-bottle-map">obtain a local storage bottle map</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#obtain-a-session-storage-bottle-map">obtain a session storage bottle map</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#obtain-a-storage-key-for-non-storage-purposes">obtain a storage key for non-storage purposes</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#storage-key">storage key</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#storage-key-equal">storage key equal</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#storage-proxy-map">storage proxy map</dfn></li>
<li><dfn data-x-href="https://storage.spec.whatwg.org/#legacy-clone-a-browsing-session-storage-shed">legacy-clone a browsing session storage shed</dfn></li>
Expand Down Expand Up @@ -89013,6 +89016,8 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location

<li><p>Let <var>topLevelOrigin</var> be null.</p></li>

<li><p>Let <var>parentStorageKey</var> be null.</p></li>

<li>
<p>If <var>browsingContext</var> is not a <span>top-level browsing context</span>, then:</p>

Expand All @@ -89021,20 +89026,25 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
data-x="bc-container">container</span>'s <span>relevant settings object</span>.</p></li>

<li><p>Set <var>topLevelCreationURL</var> to <var>parentEnvironment</var>'s <span>top-level
creation URL</span> and <var>topLevelOrigin</var> to <var>parentEnvironment</var>'s
<span>top-level origin</span>.</p></li>
creation URL</span>, <var>topLevelOrigin</var> to <var>parentEnvironment</var>'s
<span>top-level origin</span>, and <var>parentStorageKey</var> to <var>parentEnvironment</var>'s
<span>storage key</span>.</p></li>
</ol>
</li>

<li><p>Let <var>reservedStorageKey</var> be the result of running <span>compute a storage key for an
environment</span> given <var>currentURL</var> and <var>parentStorageKey</var>.

<li>
<p>Set <var>request</var>'s <span data-x="concept-request-reserved-client">reserved
client</span> to a new <span>environment</span> whose <span
data-x="concept-environment-id">id</span> is a unique opaque string, <span
data-x="concept-environment-target-browsing-context">target browsing context</span> is
<var>browsingContext</var>, <span data-x="concept-environment-creation-url">creation
URL</span> is <var>currentURL</var>, <span>top-level creation URL</span> is
<var>topLevelCreationURL</var>, and <span>top-level origin</span> is
<var>topLevelOrigin</var>.</p>
<var>topLevelCreationURL</var>, <span>top-level origin</span> is
<var>topLevelOrigin</var>, and <span data-x="concept-environment-storage-key">storage key</span>
is <var>reservedStorageKey</var>.</p>

<p class="note">The created environment's <span
data-x="concept-environment-active-service-worker">active service worker</span> is set in
Expand Down Expand Up @@ -91986,6 +91996,12 @@ interface <dfn interface>BeforeUnloadEvent</dfn> : <span>Event</span> {
the latter.</p>
</dd>

<dt>A <dfn data-x="concept-environment-storage-key" export
for="environment">storage key</dfn></dt>
<dd>
<p>A <span data-x="storage key">storage key</span>.
</dd>

<dt>A <dfn id="concept-environment-top-level-creation-url" export
for="environment">top-level creation URL</dfn></dt>
<dd><p>Null or a <span>URL</span> that represents the <span
Expand Down Expand Up @@ -104139,9 +104155,15 @@ interface <dfn interface>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope
unique opaque string, <span data-x="concept-environment-creation-url">creation URL</span> to
<var>worker global scope</var>'s <span>url</span>, <span>top-level creation URL</span> to null,
<span data-x="concept-environment-target-browsing-context">target browsing context</span> to
null, and <span data-x="concept-environment-active-service-worker">active service worker</span>
null, <span data-x="concept-environment-active-service-worker">active service worker</span>
to null.</p></li>

<li><p>Set <var>settings object</var>'s <span data-x="concept-environment-storage-key">storage
key</span> to the result of <span>compute a storage key for an environment settings object</span>
given <var>settings object</var>'s <span data-x="concept-settings-object-origin">origin</span>
and <var>outside settings</var>'s <span data-x="concept-environment-storage-key">storage
key</span>.</p></li>

<li><p>If <var>worker global scope</var> is a <code>DedicatedWorkerGlobalScope</code> object,
then set <var>settings object</var>'s <span>top-level origin</span> to <var>outside
settings</var>'s <span>top-level origin</span>.</p></li>
Expand Down Expand Up @@ -105300,6 +105322,11 @@ interface <dfn interface>WorkletGlobalScope</dfn> {};</code></pre>
<span data-x="concept-environment-active-service-worker">active service worker</span> to
null.</p></li>

<li><p>Set <var>settings object</var>'s <span data-x="concept-environment-storage-key">storage
key</span> to the result of <span>compute a storage key for an environment settings object</span>
given <var>origin</var> and <var>outsideSettings</var>'s
<span data-x="concept-environment-storage-key">storage key</span>.</p></li>

<li><p>Set <var>realm</var>'s [[HostDefined]] field to <var>settingsObject</var>.</p></li>

<li><p>Return <var>settingsObject</var>.</p></li>
Expand Down