Re: [whatwg/storage] Integrate with the Permissions spec. (#36)

> -   <li><p>Let <var>permission</var> be <a>permission</a> for <var>origin</var>.
> -
> -   <li>
> -    <p>If <var>permission</var> is "<code title>prompt</code>", then determine through asking the
> -    user or using heuristics whether <var>origin</var> is allowed to use persistent storage. If that
> -    returns a positive answer, then set <var>permission</var> to "<code title>granted</code>". If
> -    that returns a negative answer, then set <var>permission</var> to "<code title>denied</code>".
> -    If that returns no answer, then do not alter <var>permission</var>.
> -
> -    <p class="note">User agents are encouraged to not let the user answer this question twice for
> -    the same <a>origin</a> around the same time and this algorithm is not equipped to handle such a
> -    scenario.
> -
> -   <li><p>Set <a>permission</a> for <var>origin</var> to <var>permission</var>.
> +   <li><p><a>Request permission to use</a> <code>{name: {{"persistent-storage"}}}</code>,
> +   and let |permission| be the result.

> I would prefer to lead with "Let permission be ...".

That's nicer, but then what's the rest of the sentence look like? The best I've come up with is "Let *permission* be the result of [requesting permission to use](https://w3c.github.io/permissions/#request-permission-to-use) …", which will need an `lt` on the algorithm in the Permissions spec, but I can do that if you prefer.

We could also switch globally to a more ECMAScript-y syntax for algorithms, using "Let permission be [RequestPermissionToUse](https://w3c.github.io/permissions/#request-permission-to-use)({name: {{"persistent-storage"}}}</code>) …"?

> Also, is this descriptor syntax defined and explained somewhere?

Yeah, it's a [`PermissionDescriptor`](https://w3c.github.io/permissions/#permission-descriptor) or one of its subclasses. Would it help if I changed https://w3c.github.io/permissions/#request-permission-to-use to say "To request permission to use a *descriptor*, a `PermissionDescriptor` or one of its subclasses, the UA must perform the following steps."?

I've also been thinking of defining a shorthand so you can "Request permission to use" a [`PermissionName`](https://w3c.github.io/permissions/#enumdef-permissionname), which would expand to `{name: "the-name"}`.

---
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/36/files/86a18c644f5ab19df446e9ce181e53f5ba1962b6#r71902479

Received on Friday, 22 July 2016 15:59:42 UTC