Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device_orientation: Add requestPermission() to Device{Orientation,Mot…
…ion}Event STILL WIP, BLOCKED ON https://crbug.com/952824 Implement w3c/deviceorientation#68, which has added a static requestPermission() method to both DeviceOrientationEvent as well as DeviceMotionEvent. Scripts wishing to listen to these events (as well as deviceorientationabsolute) must first request permission from users by calling those methods; until then, any event listeners are registered but never triggered. Permission granted via requestPermission() is checked for after other existing checks (if the requires feature policy checks fail, for example, we still do not register the event handler at all). Implementing this requires changing how sensors permissions work in the browser: so far, users could choose between always allowing and always blocking sensor access. It is now possible to choose "Ask" as an option, in which case a modal prompt asks the user for access (dismissing the prompt or choosing "Block" both mean "Block" to the new web API). In any case, we keep "Allow" as the default option for backwards compatibility. Specifically: * In the desktop UI, it is possible to choose between "Allow", "Ask" and "Block" for sensors in chrome://settings/content/siteDetails and between "Allow" and "Ask" in chrome://settings/content/sensors. * On Android, it is currrently not possible to have per-site sensor settings; on the global site settings, we now have a tri-state choice between "Allow", "Ask" and "Block". Bug: 947112 Change-Id: I0e34b48fd21d56d6ac35ad55f69f992065a4bc62
- Loading branch information