Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Gamepad API - add support for vibrationActuator
https://bugs.webkit.org/show_bug.cgi?id=248989
rdar://103423250

Reviewed by Brady Eidson and Alex Christensen.

Turn on support for Gamepad.vibrationActuator on macOS 13+ now that it is
supported on this platform.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebKit/Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultGamepadVibrationActuatorEnabled):
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:

Canonical link: https://commits.webkit.org/258680@main
  • Loading branch information
cdumez committed Jan 9, 2023
1 parent 5192e92 commit 3120ab9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Expand Up @@ -2302,11 +2302,12 @@ GamepadVibrationActuatorEnabled:
status: testable
humanReadableName: "Gamepad.vibrationActuator support"
humanReadableDescription: "Support for Gamepad.vibrationActuator"
condition: ENABLE(GAMEPAD)
defaultValue:
WebKitLegacy:
default: false
WebKit:
default: false
default: defaultGamepadVibrationActuatorEnabled()
WebCore:
default: false

Expand Down
11 changes: 11 additions & 0 deletions Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
Expand Up @@ -199,4 +199,15 @@ bool defaultShowModalDialogEnabled()
#endif
}

#if ENABLE(GAMEPAD)
bool defaultGamepadVibrationActuatorEnabled()
{
#if HAVE(WIDE_GAMECONTROLLER_SUPPORT)
return true;
#else
return false;
#endif
}
#endif

} // namespace WebKit
4 changes: 4 additions & 0 deletions Source/WebKit/Shared/WebPreferencesDefaultValues.h
Expand Up @@ -85,6 +85,10 @@ bool defaultVisualTranslationEnabled();
bool defaultRemoveBackgroundEnabled();
#endif

#if ENABLE(GAMEPAD)
bool defaultGamepadVibrationActuatorEnabled();
#endif

bool defaultShouldTakeSuspendedAssertions();
bool defaultShowModalDialogEnabled();

Expand Down

0 comments on commit 3120ab9

Please sign in to comment.