Re: [deviceorientation] Add integration with Permissions Policy (#64)

The additional "magnetometer" requirement for ondeviceorientation on WebKit seems to come from [the non-standard version of the Device Orientation API shipped on iOS](https://github.com/WebKit/WebKit/blob/992f5b0/Source/WebCore/dom/DeviceOrientationEvent.idl#L38) and its compass-related attributes:

``` webidl
    [ImplementedAs=compassHeading] readonly attribute unrestricted double? webkitCompassHeading;
    [ImplementedAs=compassAccuracy] readonly attribute unrestricted double? webkitCompassAccuracy;
    undefined initDeviceOrientationEvent(optional [AtomString] DOMString type = "",
                                    optional boolean bubbles = false,
                                    optional boolean cancelable = false,
                                    optional unrestricted double? alpha = null,
                                    optional unrestricted double? beta = null,
                                    optional unrestricted double? gamma = null,
                                    optional unrestricted double? compassHeading = null,
                                    optional unrestricted double? compassAccuracy = null);
```

(see also: [Apple's DeviceOrientationEvent documentation](https://developer.apple.com/documentation/webkitjs/deviceorientationevent))

The non-iOS version of the Web IDL excerpt above allows creating a synthetic DeviceOrientation event with `absolute=true`:

``` webidl
    readonly attribute boolean? absolute;
    undefined initDeviceOrientationEvent(optional [AtomString] DOMString type = "",
                                    optional boolean bubbles = false,
                                    optional boolean cancelable = false,
                                    optional unrestricted double? alpha = null,
                                    optional unrestricted double? beta = null,
                                    optional unrestricted double? gamma = null,
                                    optional boolean? absolute = null);
```

but the ondeviceorientationabsolute event itself (which would require magnetometer access) is not supported.

My proposal is to standardize Blink's behavior (i.e. require "accelerometer"+"gyroscope" for ondevicemotion and ondeviceorientation, and "accelerometer"+"gyroscope"+"magnetometer" for ondeviceorientationabsolute) instead.

-- 
GitHub Notification of comment by rakuco
Please view or discuss this issue at https://github.com/w3c/deviceorientation/issues/64#issuecomment-1787278776 using your GitHub account


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

Received on Tuesday, 31 October 2023 14:00:09 UTC