[Bug 27048] Allow partial enums

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27048

Tobie Langel <tobie.langel@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobie.langel@gmail.com

--- Comment #3 from Tobie Langel <tobie.langel@gmail.com> ---
So this issue was brought up again today as I'm moving forward with the Generic
Sensor API.

Here's the concrete use case:

The editor writes a spec for the Heartbeat Sensor. Said spec obviously requires
permissioning. Currently this requires amending the Permissions API to add a
corresponding string (e.g. "heartbeat-sensor") to the PermissionName Enum[1].

Now, what happens when an implementor decides to implement the Permissions API,
but not the Heartbeat sensor? Will he filter the corresponding string out of
the enum?

If an implementor decides to implement the Heartbeat Sensor API, then removes
it because it turns out the privacy concerns are to big, aren't the risks of
forgetting to modify the enum higher if it lies in the Permissions API? In that
case, developers could potentially have the Permission's API tell them the user
has granted access to a sensor that's no longer implemented. Seems strange.

None of these are an issue if the "heartbeat-sensor" string is added to the
PermissionName Enum[1] from the Heartbeat Sensor spec itself. I'm also not sure
there are any downsides to having a split enum in this concrete example. Quite
the contrary, actually, as it seems much more logical to split cross-cutting
concerns like these across specs.

(Note I'm not suggesting that partial enums are the right choices in all use
cases, but it's not because a hammer isn't the appropriate tool to fix a pair
of glasses that a carpenter shouldn't be able to use one.)

[1]: https://w3c.github.io/permissions/#idl-def-PermissionName

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 4 February 2016 16:22:14 UTC