[deviceorientation] Pull Request: Add Permissions API integration, start requiring requestPermission() usage

rakuco has just submitted a new pull request for https://github.com/w3c/deviceorientation:

== Add Permissions API integration, start requiring requestPermission() usage ==
This substantive and breaking change integrates the existing
requestPermission() calls with the Permissions API, so that we do not need
to essentially redefine the "request permission to use" algorithm here.

Additionally, calling requestPermission() is now a requirement, as
devicemotion, deviceorientation and deviceorientationabsolute events are
fired only when the permission state is "granted". This matches WebKit's
current behavior. Blink's plan is to follow suit in the near future.

The powerful feature names are identical to those proposed in #121:
"accelerometer", "gyroscope", and "magnetometer", which match the low-level
sensors that provide the data in the events fired by this specification.
These names also match those in the Accelerometer, Gyroscope and
Magnetometer specifications, which allows developers who want to transition
between these APIs to avoid having to request access to different powerful
feature names with the same goal.

Also similarly to #121, the idea is to:
- Require "accelerometer" and "gyroscope" for the devicemotion event.
- Require "accelerometer" and "gyroscope" to provide relative
  orientation data for the deviceorientation event, and additionally
  "magnetometer" to fall back to absolute orientation data.
- Requires "accelerometer", "gyroscope", and "magnetometer" for the
  deviceorientationabsolute event.

DeviceOrientationEvent.requestPermission() now takes an optional `absolute`
argument (defaulting to false) to specify whether it will also request the
"magnetometer" permission.

IMPORTANT: As far as I can see, the WebKit implementation does not integrate
with the Permissions API. It therefore does not use the powerful feature
names described above, nor does support the new `absolute` argument or the
requesting of different permissions depending on whether developers want to
access to absolute orientation data.

Fixes #70.


See https://github.com/w3c/deviceorientation/pull/123


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 14 November 2023 20:17:35 UTC