diff --git a/storage.bs b/storage.bs index 562ce28..42d1d4c 100644 --- a/storage.bs +++ b/storage.bs @@ -185,13 +185,30 @@ anticipated that some APIs will be applicable to both storage types going -

Storage sheds

+

Storage keys

A storage key is an origin. [[HTML]]

This is expected to change, see Client-Side Storage Partitioning. +

To obtain a storage key, given an environment settings object +environment, run these steps: + +

    +
  1. Let key be environment's + origin. + +

  2. If key is an opaque origin, then return failure. + +

  3. If the user has disabled storage, then return failure. + +

  4. Return key. +

+ + +

Storage sheds

+

A storage shed is a map of storage keys to storage shelves. It is initially empty. @@ -211,6 +228,28 @@ It is initially empty. browsing session. It is roughly analogous to top-level browsing context except that it cannot be replaced due to Cross-Origin-Opener-Policy or navigation. +

To legacy-clone a browsing session storage shed, given a browsing session +A and a browsing session B, run these steps: + +

    +
  1. +

    For each keyshelf of A's + storage shed: + +

      +
    1. Let newShelf be the result of running create a storage shelf with + "session". + +

    2. Set newShelf's bucket map["default"]'s + bottle map["sessionStorage"]'s map to a + clone of shelf's bucket map["default"]'s + bottle map["sessionStorage"]'s map. + +

    3. Set B's storage shed[key] to + newShelf. +

    +
+

Storage shelves

@@ -228,24 +267,14 @@ given a value when a storage shelf is type, run these steps:
    -
  1. Let key be environment's - origin. +

  2. Let key be the result of running obtain a storage key with + environment. -

  3. If key is an opaque origin, then return failure. +

  4. If key is failure, then return failure. -

  5. If the user has disabled storage, then return failure. - -

  6. -

    If shed[key] does not exist, then: - -

      -
    1. Let shelf be a new storage shelf. - -

    2. Set shelf's bucket map["default"] to the result of - create a storage bucket with type. - -

    3. Set shed[key] to shelf. -

    +
  7. If shed[key] does not exist, then set + shed[key] to the result of running create a storage shelf with + type.

  8. Return shed[key].

@@ -254,6 +283,18 @@ given a value when a storage shelf is environment, return the result of running obtain a storage shelf with the user agent's storage shed, environment, and "local". +

To create a storage shelf, given a storage type type, run these +steps: + +

    +
  1. Let shelf be a new storage shelf. + +

  2. Set shelf's bucket map["default"] to the result of running + create a storage bucket with type. + +

  3. Return shelf. +

+

Storage buckets