-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add hooks for HTML #93
Conversation
This comment has been minimized.
This comment has been minimized.
"legacy-clone a browsing session storage shed" can be used by HTML to define creation of auxiliary browsing contexts, as part of whatwg/html#5560. "obtain a storage key" can be used by APIs that share keying logic with storage, such as BroadcastChannel and shared workers. See whatwg/html#3054. It's potentially also useful for Indexed DB as discussed in w3c/IndexedDB#334. Closes #92.
8561fc5
to
6c43079
Compare
Since nobody has reviewed this yet I'm adding @domenic to the mix. As discussed in whatwg/html#5560 I'll also add some text here that was previously part of sessionStorage/localStorage but is really more broadly applicable to all storage endpoints. |
Apologies for not having provided feedback yet. It's on my to-do list. But don't block on me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems pretty reasonable. The only thing I feel somewhat strongly about is adding a note explaining why that operation is legacy.
@@ -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>". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little unclear why "local" gets special treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an exported algorithm. I added this for a number of internal callers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case it seems like it'd be even nicer to just let the internal callers pass "local" as an argument instead of as part of the algorithm name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They would also have to pass in the storage shed. I think it's worth having the abstraction (and this was already approved as part of a prior PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, just adding my two cents as a reader that it makes things pretty confusing. Up to you whether to fix it or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this case confusing but other similar cases are not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other cases appear to be symmetrical, with shortcut definitions for both local and session. If there are ones I missed where local is special (but not called out with a note as to why it's special), then I agree those are also confusing.
<li><p>Set <var>shed</var>[<var>key</var>] to <var>shelf</var>. | ||
</ol> | ||
<li><p>If <var>shed</var>[<var>key</var>] does not <a for=map>exist</a>, then set | ||
<var>shed</var>[<var>key</var>] to the result of running <a>create a storage shelf</a> with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the result of creating a storage shelf" perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be less locally consistent.
"legacy-clone a browsing session storage shed" can be used by HTML to define creation of auxiliary browsing contexts, as part of whatwg/html#5560.
"obtain a storage key" can be used by APIs that share keying logic with storage, such as BroadcastChannel and shared workers. See whatwg/html#3054. It's potentially also useful for Indexed DB as discussed in w3c/IndexedDB#334.
Closes #92.
Preview | Diff