w3c / deviceorientation

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

Add automation support via WebDriver #124

Closed rakuco closed 6 months ago

rakuco commented 8 months ago

This PR integrates with the automation concepts defined in https://w3c.github.io/sensors/#automation to allow providing motion or orientation readings via virtual sensors through the WebDriver extension commands defined there.

IMPORTANT: This does not mean that this specification requires implementations to support the Generic Sensor API specification and its derived specifications. Only the Automation section is being referenced, and when necessary some algorithms and definitions are being duplicated here, especially for Device Motion automation.

Device Orientation:

Device Motion:

Fixes #122.


Preview | Diff

rakuco commented 8 months ago

@reillyeon PTAL. This depends on w3c/sensors#475.

I'm not a fan of how hand-wavy this spec is in a lot of places, and the bit in https://w3c.github.io/deviceorientation/#deviceorientation that acts on a significant change in orientation is not checking the virtual sensors.

rakuco commented 6 months ago

Thank you for the review, @reillyg!