Skip to content
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

Merged
merged 6 commits into from
Jun 5, 2020
Merged

Add hooks for HTML #93

merged 6 commits into from
Jun 5, 2020

Conversation

annevk
Copy link
Member

@annevk annevk commented May 20, 2020

"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

@annevk

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.
@annevk annevk changed the title Add obtain a storage key Add hooks for HTML May 20, 2020
@annevk annevk mentioned this pull request May 20, 2020
3 tasks
@annevk annevk requested a review from domenic May 29, 2020 13:21
@annevk
Copy link
Member Author

annevk commented May 29, 2020

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.

@inexorabletash
Copy link
Member

Apologies for not having provided feedback yet. It's on my to-do list. But don't block on me.

Copy link
Member

@domenic domenic left a 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.

storage.bs Show resolved Hide resolved
@@ -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>".
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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).

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

storage.bs Outdated Show resolved Hide resolved
storage.bs Outdated Show resolved Hide resolved
storage.bs Outdated Show resolved Hide resolved
<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
Copy link
Member

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?

Copy link
Member Author

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.

storage.bs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Define obtain a storage key
3 participants