-
Notifications
You must be signed in to change notification settings - Fork 64
Add top-level site and cross site ancestry to storage key #182
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
base: main
Are you sure you want to change the base?
Changes from 8 commits
262d10d
72237a2
fc339da
a4db459
8bdb828
18f3bb4
a5134b4
ceeca13
5904cd8
dfc0a6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,10 +207,9 @@ 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 boolean). [[!HTML]] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's rename this to "has cross-site ancestor" to align with what HTML ended up with. |
||
|
|
||
| <div algorithm> | ||
| <p>To <dfn export>obtain a storage key</dfn>, given an <a for=/>environment</a> | ||
|
|
@@ -239,7 +238,18 @@ 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 <a>obtaining 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>. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @domenic @bvandersloot-mozilla now that has cross-site ancestor is no longer on environment, how is this going to work here?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Um. I think it just never came up in whatwg/html#11133, when I convinced @bvandersloot-mozilla to switch to ESO, that we were hoping to use this for storage keys. I noticed that we already have a branch in https://storage.spec.whatwg.org/#obtain-a-storage-key-for-non-storage-purposes which treats ESOs specially. Would that work here? Probably not. It would give the wrong answer during the phase when only an environment exists, but not an ESO, such as when navigation has started but not yet gotten as far as creating a So... unless there's something that's missing, I think I really screwed up here, and we should go back to @bvandersloot-mozilla's original approach. It is much more complex, but it seems to be necessary, if we're planning to use this during the liminal pre-ESO time.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's been a long time since I looked at all this, but I think pre-ESO is important for service worker allocation. |
||
|
|
||
| <li><p>Return (<var>origin</var>, <var>topLevelSite</var>, <var>crossSiteAncestry</var>). | ||
| </ol> | ||
| </div> | ||
|
|
||
|
|
@@ -251,6 +261,13 @@ 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 for="site">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 | ||
| <var>B</var>'s <a for="storage key">cross-site ancestry</a>, then return false. | ||
|
|
||
| <li><p>Return true. | ||
| </ol> | ||
| </div> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.