-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gamepad: Align closer to spec and implement missing slots #31385
Conversation
🔨 Triggering try run (#8016745639) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#8016745639): Flaky unexpected result (15)
Stable unexpected results that are known to be intermittent (17)
|
✨ Try run (#8016745639) succeeded. |
components/script/dom/globalscope.rs
Outdated
}), | ||
window.upcast(), | ||
) | ||
.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you should check if gamepad_task_source is not None
to avoid unwrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is about the queuing of the task, but we should expect with a clear message.
- Fixes TODO's from initial gamepad implementation - Adds some missing spec steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start! Couple of comments...
components/script/dom/globalscope.rs
Outdated
}), | ||
window.upcast(), | ||
) | ||
.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is about the queuing of the task, but we should expect with a clear message.
- 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks for the refactor, just one last thing and then good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one nit.
GamepadUpdateType::Button(_, value) => { | ||
return value > BUTTON_PRESS_THRESHOLD; | ||
}, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just add a newline here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second one? It ends at 297
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, should be fine then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This follows up from the initial Gamepad implementation and addresses some TODOs around
gamepad.[[exposed]]
andnavigator.[[hasGamepadGesture]]
, as well as some missing spec steps. It also properly gates gamepad handling behind thedom.gamepad.enabled
pref, as previously thegamepadconnected
andgamepaddisconnected
events would fire regardless.This also allows one more WPT test to pass,
gamepad/not-fully-active
../mach build -d
does not report any errors./mach test-tidy
does not report any errors