From 95c10bf66bf9c1cb15141f7c3c1ff115ea20b083 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Mon, 16 May 2022 21:22:24 +0000 Subject: [PATCH] Compute storage keys to be stored on environments. (#142) --- storage.bs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/storage.bs b/storage.bs index 18f7985..619beb0 100644 --- a/storage.bs +++ b/storage.bs @@ -222,6 +222,9 @@ anticipated that some APIs will be applicable to both storage types going

To obtain a storage key for non-storage purposes, given an environment environment, run these steps: +

This algorithm will be removed or updated once the html spec is +modified to store a storage key directly on environment. +

  1. Let origin be environment's origin if environment is an @@ -231,6 +234,29 @@ anticipated that some APIs will be applicable to both storage types going

  2. Return a tuple consisting of origin.

+

To compute a storage key for an environment settings object, +given an origin origin and an optional +storage key parent-or-outer storage key, run these steps: + +

    +
  1. Return a tuple consisting of origin. +
+ +

The parent-or-outer storage key will be used in the future to +compute and propagate additional values in the storage key in the future. +For example, top-level site, the ancestor-chain bit, or anonymous iframe +nonce.

+ +

To compute a storage key for an environment, given a +url creation url and an optional storage key +parent storage key, run these steps: + +

    +
  1. Let origin be creation url's origin. +
  2. Return the result of running compute a storage key for an environment + settings object given origin and parent storage key +
+

To determine whether a storage key A equals storage key B, run these steps: