Re: [whatwg/storage] Add hooks for HTML (#93)

@domenic approved this pull request.

Seems pretty reasonable. The only thing I feel somewhat strongly about is adding a note explaining why that operation is legacy.

> +  <p><a for=map>For each</a> <var>key</var> → <var>shelf</var> of <var>A</var>'s
+  <a for="browsing session">storage shed</a>:
+
+  <ol>
+   <li><p>Let <var>newShelf</var> be the result of running <a>create a storage shelf</a> with
+   "<code>session</code>".
+
+   <li><p>Set <var>newShelf</var>'s <a>bucket map</a>["<code>default</code>"]'s
+   <a>bottle map</a>["<code>sessionStorage</code>"]'s <a for="storage bottle">map</a> to a
+   <a for=map>clone</a> of <var>shelf</var>'s <a>bucket map</a>["<code>default</code>"]'s
+   <a>bottle map</a>["<code>sessionStorage</code>"]'s <a for="storage bottle">map</a>.
+
+   <li><p>Set <var>B</var>'s <a for="browsing session">storage shed</a>[<var>key</var>] to
+   <var>newShelf</var>.
+  </ol>
+</ol>

It'd be good to add a note explaining why this is legacy. The algorithm seems very sensible and generally applicable.

> @@ -254,12 +283,22 @@ given a <a for=map>value</a> when a <a>storage shelf</a> is
 <var>environment</var>, return the result of running <a>obtain a storage shelf</a> with the user
 agent's <a for="user agent">storage shed</a>, <var>environment</var>, and "<code>local</code>".

It's a little unclear why "local" gets special treatment.

> +<a>bucket map</a> <a for=map lt="is empty">empty</a>, then <a for=map>remove</a> that
+<a>storage shelf</a> and corresponding <a>storage key</a> from the encompassing
+<a for=/>storage shed</a>.
+
+
+<h3 id=storage-pressure>Storage pressure</h3>
+
+<p>A user agent that comes under storage pressure should clear network state and
+<a>local storage buckets</a> whose <a for="local storage bucket">mode</a> is
+"<code>best-effort</code>", ideally prioritizing removal in a manner that least impacts the user.
+
+<p>If a user agent continues to be under storage pressure, then the user agent should inform the
+user and offer a way to clear the remaining <a>local storage buckets</a>, i.e., those whose
+<a for="local storage bucket">mode</a> is "<code>persistent</code>".
+
+<p><a>Session storage buckets</a> must be cleared as browsing sessions are closed.

Ah, browsing session again. This time without an XXX box.

I'm starting to feel that we should add a `<dfn>` to HTML that is mostly a big XXX box, so that we can link to that single XXX box from everywhere.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/storage/pull/93#pullrequestreview-422224218

Received on Monday, 1 June 2020 22:32:36 UTC