Skip to content
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

Shouldn't Gamepad.vibrationActuator be nullable? #178

Closed
cdumez opened this issue Jan 10, 2023 · 1 comment · Fixed by #181
Closed

Shouldn't Gamepad.vibrationActuator be nullable? #178

cdumez opened this issue Jan 10, 2023 · 1 comment · Fixed by #181

Comments

@cdumez
Copy link

cdumez commented Jan 10, 2023

It is currently not marked as nullable in the Web DIL here:

However, the specification for "Construction" seems to indicate it can be null:

Add new steps to a new Gamepad:

If gamepad has a vibration actuator that can play effects with type "dual-rumble", initialize gamepad's vibrationActuator attribute to a new GamepadHapticActuator with "dual-rumble".
Otherwise, initialize gamepad's vibrationActuator attribute to null.

@cdumez
Copy link
Author

cdumez commented Jan 10, 2023

cc @marcoscaceres

webkit-commit-queue pushed a commit to cdumez/WebKit that referenced this issue Jan 12, 2023
https://bugs.webkit.org/show_bug.cgi?id=250411

Reviewed by Brent Fulgham.

Gamepad.vibrationActuator should be nullable:
- w3c/gamepad#178

Gamepad.vibrationActuator is supposed to return null if the gamepad doesn't support dual-rumble:
- https://w3c.github.io/gamepad/extensions.html#gamepadhapticactuator-interface (Construction section)

* LayoutTests/gamepad/gamepad-event-handlers.html:
* LayoutTests/gamepad/gamepad-polling-access.html:
* LayoutTests/gamepad/gamepad-timestamp.html:
* LayoutTests/gamepad/gamepad-vibrationActuator-SameObject.html:
* LayoutTests/gamepad/gamepad-vibrationActuator-nullable-expected.txt: Added.
* LayoutTests/gamepad/gamepad-vibrationActuator-nullable.html: Added.
* LayoutTests/gamepad/gamepad-vibrationActuator-playEffect-validation.html:
* LayoutTests/gamepad/gamepad-vibrationActuator-type.html:
* LayoutTests/gamepad/gamepad-visibility-1.html:
* Source/WebCore/Modules/gamepad/Gamepad.cpp:
(WebCore::Gamepad::Gamepad):
(WebCore::Gamepad::vibrationActuator): Deleted.
* Source/WebCore/Modules/gamepad/Gamepad.h:
* Source/WebCore/Modules/gamepad/Gamepad.idl:
* Source/WebCore/testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):
(WebCore::MockGamepad::updateDetails):
* Source/WebCore/testing/MockGamepad.h:
* Source/WebCore/testing/MockGamepadProvider.cpp:
(WebCore::MockGamepadProvider::setMockGamepadDetails):
* Source/WebCore/testing/MockGamepadProvider.h:
* Source/WebCore/testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setMockGamepadDetails):
* Source/WebCore/testing/js/WebCoreTestSupport.h:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMockGamepadDetails):
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.h:
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

Canonical link: https://commits.webkit.org/258812@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant