Require a button press on a gamepad for them to be exposed to the DOM.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2017 02:24:17 +0000 (02:24 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2017 02:24:17 +0000 (02:24 +0000)
commit25634c1534901d9e5885a21c34b54b78fe7fb8b8
treecaa7726876e2a486875ee9250b7b5721c77f78b0
parent661bd868c50850aa7fee915d74ab8f16e798d110
Require a button press on a gamepad for them to be exposed to the DOM.
<rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272

Reviewed by Alex Christensen.

Source/WebCore:

Test: gamepad/gamepad-visibility-1.html

* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadInputActivity):
* Modules/gamepad/GamepadManager.h:

* platform/gamepad/GamepadProvider.cpp:
(WebCore::GamepadProvider::dispatchPlatformGamepadInputActivity):
* platform/gamepad/GamepadProvider.h:
(WebCore::GamepadProvider::~GamepadProvider): Deleted.
(WebCore::GamepadProvider::isMockGamepadProvider): Deleted.

* platform/gamepad/GamepadProviderClient.h:

* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):

* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::gamepadHadInput):
(WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):

* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::valueChanged):
* platform/gamepad/mac/HIDGamepad.h:

* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::valuesChanged):
(WebCore::HIDGamepadProvider::inputNotificationTimerFired):
* platform/gamepad/mac/HIDGamepadProvider.h:

* testing/MockGamepadProvider.cpp:
(WebCore::MockGamepadProvider::setMockGamepadButtonValue):
(WebCore::MockGamepadProvider::gamepadInputActivity):
* testing/MockGamepadProvider.h:

Source/WebKit2:

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::gamepadSyncTimerFired):
(WebKit::UIGamepadProvider::platformGamepadInputActivity):
* UIProcess/Gamepad/UIGamepadProvider.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::gamepadActivity):
* UIProcess/WebPageProxy.h:

* WebProcess/Gamepad/WebGamepadProvider.cpp:
(WebKit::WebGamepadProvider::gamepadActivity):
* WebProcess/Gamepad/WebGamepadProvider.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::gamepadActivity):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

LayoutTests:

* gamepad/gamepad-visibility-1-expected.txt: Added.
* gamepad/gamepad-visibility-1.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/gamepad/gamepad-visibility-1-expected.txt [new file with mode: 0644]
LayoutTests/gamepad/gamepad-visibility-1.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/gamepad/GamepadManager.cpp
Source/WebCore/Modules/gamepad/GamepadManager.h
Source/WebCore/platform/gamepad/GamepadProvider.cpp
Source/WebCore/platform/gamepad/GamepadProvider.h
Source/WebCore/platform/gamepad/GamepadProviderClient.h
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.h
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.h
Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm
Source/WebCore/platform/gamepad/mac/HIDGamepad.cpp
Source/WebCore/platform/gamepad/mac/HIDGamepad.h
Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp
Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.h
Source/WebCore/testing/MockGamepadProvider.cpp
Source/WebCore/testing/MockGamepadProvider.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp
Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/Gamepad/WebGamepadProvider.cpp
Source/WebKit2/WebProcess/Gamepad/WebGamepadProvider.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in