w3c / deviceorientation

W3C Device Orientation spec
https://www.w3.org/TR/orientation-event/
Other
49 stars 32 forks source link

Add Permissions Policy integration #121

Closed rakuco closed 7 months ago

rakuco commented 8 months ago

This substantive change makes the firing of the events defined in this specification dependent on a few different policy-controlled features: "accelerometer", "gyroscope", and "magnetometer.

Both Blink and WebKit already integrate their implementations with the Permissions Policy spec and use the same tokens, although a bit differently:

We have opted to codify Blink's behavior in the specification, as since relative orientation data does not require a magnetometer sensor, the event should not require the corresponding token either.

Fixes #64.


Preview | Diff

rakuco commented 8 months ago

@reillyeon the Accelerometer, Gyroscope and Magnetometer specifications already define and export the same policy-controlled feature tokens with the same allowlists. I considered referencing them here, but opted for redefining them here given the concerns about depending on definitions from specs less far along the standards track. Please let me know what you think.

reillyeon commented 8 months ago

@rakuco, when updating a PR please don't use a force push as it breaks the relationship between the original changes and the updated changes.

rakuco commented 8 months ago

@rakuco, when updating a PR please don't use a force push as it breaks the relationship between the original changes and the updated changes.

Sorry. I think this was a problem specific to this PR, as I'd sent it targeting the branch I'd created for #120 since I needed those changes, and when it was merged with some suggested changes GitHub got confused.

rakuco commented 8 months ago

Before merging, I'd just like to double check

reillyeon commented 8 months ago

Before merging, I'd just like to double check

  • That it's better to duplicate the "accelerometer", "gyroscope" and "magnetometer" tokens here instead of using those defined and exported by the respective specs.

Given that these are part of the normative requirements what do you think about moving the definitions here and referencing from the Generic Sensors specs?

  • Whether there needs to be any involvement from the WebApps WG since this is a substantive change.

The relationship hasn't been formalized yet but ideally we could hold a joint meeting to discuss these Permissions / Permissions Policy integrations.

rakuco commented 7 months ago

Given that these are part of the normative requirements what do you think about moving the definitions here and referencing from the Generic Sensors specs?

Ack. As discussed here and in #123, I've pushed a new commit here exporting the permissions policy tokens in this specification.

Like with #123, I'm deferring merging to you and @anssiko in case the WebApps WG needs to be involved.

anssiko commented 7 months ago

@rakuco can you fix the merge conflicts.

rakuco commented 7 months ago

@rakuco can you fix the merge conflicts.

Done. I'll proceed and merge. Thanks everyone!