Intent to Ship: Implement requestPermission() for DeviceOrientationEvent and DeviceMotionEvent

84 views
Skip to first unread message

Raphael Kubo da Costa

unread,
Oct 13, 2023, 9:43:46 AM10/13/23
to blink-dev

Contact emails

raphael.ku...@intel.com, rei...@chromium.org

Explainer

None

Specification

https://w3c.github.io/deviceorientation

Summary

Allows developers to ask for permission to use the Device Orientation and Device Motion APIs. Access to these APIs is currently granted by default, and these new functions are part of the long-term plan to require requesting permission before using window.ondevicemotion and window.ondeviceorientation.

This API has been implemented behind an off-by-default flag since M105. The goal of this Intent to Ship email is to provide this API by default without changing the current implementation that only reports the permissions that have already been set. Shipping this API by default would allow us to get better UseCounter numbers to determine how many sites are already calling requestPermission() due to WebKit's requirements. This helps us move towards always requesting sensor access by default and stop granting permissions by default. This was also discussed at TPAC in 2023: https://www.w3.org/2023/09/14-dap-minutes.html#t13

Changing the sensors permission model, making this API actually request access and not granting sensor access permissions by default will be done separately and at a later date.


Blink component

Blink>Sensor>DeviceOrientation

Search tags

device orientation, device motion

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The current implementation of this API in Chromium does not actually request permission, but merely report what the current permission settings are: "granted" or "denied" based on the corresponding motion sensor permission settings (there is no "ask" state for motion sensors at the moment). There are no risks with shipping this API in its current form: it just reports the permissions that have already been set.


Gecko: Under consideration (https://bugzilla.mozilla.org/show_bug.cgi?id=1536382)

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=195329)

Web developers: No signals

Other signals: Lots of comments in the Chromium tracking bug over the years

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

-


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes
Finch feature nameDeviceOrientationRequestPermission

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=947112

Estimated milestones

Shipping on desktop 121
DevTrial on desktop 105
Shipping on Android 121
DevTrial on Android 105

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5051845089689600

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a7bfbf70-0cbf-709f-6310-7af1101c2574%40intel.com

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Oct 13, 2023, 1:50:27 PM10/13/23
to Raphael Kubo da Costa, blink-dev
Please fill out and start the review for the five other review categories on your chromestatus entry, thanks. 

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c27d2bdc-4d62-4d2d-9722-62b66ce88173%40intel.com.
Reply all
Reply to author
Forward
0 new messages