IDL changes for gamepad support
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 02:03:15 +0000 (02:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 02:03:15 +0000 (02:03 +0000)
commit9bf63ddfddefbe5d5850f5675aa2ea7180888d7e
treec08cfa494f7b24ff6edad4f00746ea0128fc1105
parentea45b186f1a96da8a51db84850baa87d98ec445f
IDL changes for gamepad support
https://bugs.webkit.org/show_bug.cgi?id=71753

Patch by Scott Graham <scottmg@chromium.org> on 2011-11-18
Reviewed by Adam Barth.

Source/WebCore:

IDL changes and associated plumbing to expose list of gamepad objects
on navigator object (per current spec). Full patch is
https://bugs.webkit.org/show_bug.cgi?id=69451. Only basic existence
test until more plumbing in future patches.

Test: gamepad/gamepad-api.html

* WebCore.gypi:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebkitGamepadsEnabled):
(WebCore::RuntimeEnabledFeatures::webkitGamepadsEnabled):
* page/Gamepad.cpp: Added.
(WebCore::Gamepad::Gamepad):
(WebCore::Gamepad::axes):
(WebCore::Gamepad::buttons):
(WebCore::Gamepad::~Gamepad):
* page/Gamepad.h: Added.
* page/Gamepad.idl: Added.
* page/GamepadList.cpp: Added.
(WebCore::GamepadList::~GamepadList):
(WebCore::GamepadList::set):
(WebCore::GamepadList::length):
(WebCore::GamepadList::item):
* page/GamepadList.h: Added.
(WebCore::GamepadList::create):
(WebCore::GamepadList::GamepadList):
* page/GamepadList.idl: Added.
* page/Navigator.cpp:
(WebCore::Navigator::webkitGamepads):
* page/Navigator.h:
* page/Navigator.idl:

Source/WebKit/chromium:

Update to use vendor-prefixed enable.

* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableGamepad):
(WebKit::WebRuntimeFeatures::isGamepadEnabled):

Tools:

Runtime enable gamepad in chromium test shell.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):

LayoutTests:

Add basic api existence test.

* gamepad/gamepad-api-expected.txt: Added.
* gamepad/gamepad-api.html: Added.
* gamepad/gamepad-test.js: Added.
(logConsole):
(testExpected):
(reportExpected):
(waitForEventAndEnd):
(waitForEvent._eventCallback):
(waitForEvent):
(waitForEventAndTest._eventCallback):
(waitForEventAndTest):
(waitForEventTestAndEnd):
(endTest):
(logResult):
(consoleWrite):
* platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/efl/Skipped:
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
LayoutTests/ChangeLog
LayoutTests/gamepad/gamepad-api-expected.txt [new file with mode: 0644]
LayoutTests/gamepad/gamepad-api.html [new file with mode: 0644]
LayoutTests/gamepad/gamepad-test.js [new file with mode: 0644]
LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt
LayoutTests/platform/efl/Skipped
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/platform/wincairo/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/page/Gamepad.cpp [new file with mode: 0644]
Source/WebCore/page/Gamepad.h [new file with mode: 0644]
Source/WebCore/page/Gamepad.idl [new file with mode: 0644]
Source/WebCore/page/GamepadList.cpp [new file with mode: 0644]
Source/WebCore/page/GamepadList.h [new file with mode: 0644]
Source/WebCore/page/GamepadList.idl [new file with mode: 0644]
Source/WebCore/page/Navigator.cpp
Source/WebCore/page/Navigator.h
Source/WebCore/page/Navigator.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestShell.cpp