mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Gamepad: Align closer to spec and implement missing slots (#31385)
* Implement missing gamepad slots, align to spec more - Fixes TODO's from initial gamepad implementation - Adds some missing spec steps * Only handle gamepad events when pref is enabled * Return empty list in getGamepads if document not active * ./mach fmt * Update getGamepads to return an array instead of GamepadList * Add spec link for [[exposed]] slot * Remove failing test expectations for not-fully-active * A few fixes - Change should_notify to has_gesture - Add spec links and TODO to navigator - Remove unneeded clone from GamepadList::list - Move gamepadconnected event firing into has_gesture block * Use queue_with_canceller for tasks and add expects * Explicitly check for gamepad user gesture * Move user gesture check into separate function * Change contains_user_gesture to be a gamepad function * mach fmt * Change axis/button threshold constants to be private to module
This commit is contained in:
parent
31a50feb4a
commit
48fa77df67
8 changed files with 124 additions and 45 deletions
|
@ -69,7 +69,7 @@ partial interface Navigator {
|
|||
|
||||
// https://w3c.github.io/gamepad/#navigator-interface-extension
|
||||
partial interface Navigator {
|
||||
[Pref="dom.gamepad.enabled"] GamepadList getGamepads();
|
||||
[Pref="dom.gamepad.enabled"] sequence<Gamepad?> getGamepads();
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#navigatorconcurrenthardware
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue