Skip to content
29 changes: 24 additions & 5 deletions storage.bs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
</pre>

<pre class=link-defaults>
spec:html; type:dfn; for:site; text:same site
spec:infra; type:dfn; text:implementation-defined
spec:infra; type:dfn; text:user agent
</pre>
Expand Down Expand Up @@ -207,10 +208,10 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
<h3 id=storage-keys>Storage keys</h3>

<p>A <dfn export>storage key</dfn> is a <a>tuple</a> consisting of an
<dfn for="storage key">origin</dfn> (an <a for=/>origin</a>). [[!HTML]]

<p class=XXX>This is expected to change; see
<a href="https://privacycg.github.io/storage-partitioning/">Client-Side Storage Partitioning</a>.
<dfn for="storage key">origin</dfn> (an <a for=/>origin</a>), a
<dfn for="storage key">top-level site</dfn> (a <a for=/>site</a>), and a
<dfn for="storage key">cross site ancestry</dfn>
(a <a for=environment>cross site ancestry</a>). [[!HTML]]

<div algorithm>
<p>To <dfn export>obtain a storage key</dfn>, given an <a for=/>environment</a>
Expand Down Expand Up @@ -239,7 +240,19 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
<a>environment settings object</a>; otherwise <var>environment</var>'s
<a for=environment>creation URL</a>'s <a for=url>origin</a>.

<li><p>Return a <a>tuple</a> consisting of <var>origin</var>.
<li><p>Let <var>topLevelOrigin</var> be <var>environment</var>'s
<a for=environment>top-level origin</a>.

<li><p>If <var>topLevelOrigin</var> is null, then set it to <var>origin</var>.

<li><p>Let <var>topLevelSite</var> be the result of of running <a>obtain a site</a>
given <var>topLevelOrigin</var>.

<li><p>Let <var>crossSiteAncestry</var> be <var>environment</var>'s
<a for=environment>cross site ancestry</a>.

<li><p>Return a tuple consisting of (<var>origin</var>, <var>topLevelSite</var>,
<var>crossSiteAncestry</var>).
</ol>
</div>

Expand All @@ -251,6 +264,12 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
<li><p>If <var>A</var>'s <a for="storage key">origin</a> is not <a>same origin</a> with
<var>B</var>'s <a for="storage key">origin</a>, then return false.

<li><p>If <var>A</var>'s <a for="storage key">top-level site</a> is not <a>same site</a>
with <var>B</var>'s <a for="storage key">top-level site</a>, then return false.

<li><p>If <var>A</var>'s <a for="storage key">cross site ancestry</a> is not equal to
<var>B</var>'s <a for="storage key">cross site ancestry</a>, then return false.

<li><p>Return true.
</ol>
</div>
Expand Down
Loading