Changeset 100833 in webkit


Ignore:
Timestamp:
Nov 18, 2011 6:03:15 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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:
Location:
trunk
Files:
10 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r100832 r100833  
     12011-11-18  Scott Graham  <scottmg@chromium.org>
     2
     3        IDL changes for gamepad support
     4        https://bugs.webkit.org/show_bug.cgi?id=71753
     5
     6        Reviewed by Adam Barth.
     7
     8        Add basic api existence test.
     9
     10        * gamepad/gamepad-api-expected.txt: Added.
     11        * gamepad/gamepad-api.html: Added.
     12        * gamepad/gamepad-test.js: Added.
     13        (logConsole):
     14        (testExpected):
     15        (reportExpected):
     16        (waitForEventAndEnd):
     17        (waitForEvent._eventCallback):
     18        (waitForEvent):
     19        (waitForEventAndTest._eventCallback):
     20        (waitForEventAndTest):
     21        (waitForEventTestAndEnd):
     22        (endTest):
     23        (logResult):
     24        (consoleWrite):
     25        * platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt:
     26        * platform/efl/Skipped:
     27        * platform/gtk/Skipped:
     28        * platform/mac/Skipped:
     29        * platform/qt/Skipped:
     30        * platform/win/Skipped:
     31        * platform/wincairo/Skipped:
     32
    1332011-11-18  Sheriff Bot  <webkit.review.bot@gmail.com>
    234
  • trunk/LayoutTests/platform/chromium/fast/dom/navigator-detached-no-crash-expected.txt

    r92315 r100833  
    1818navigator.vendor is OK
    1919navigator.vendorSub is OK
     20navigator.webkitGamepads is OK
    2021navigator.appCodeName is OK
    2122navigator.appName is OK
     
    3536navigator.vendor is OK
    3637navigator.vendorSub is OK
     38navigator.webkitGamepads is OK
    3739
  • trunk/LayoutTests/platform/efl/Skipped

    r100338 r100833  
    19101910fast/forms/week
    19111911
     1912# ENABLE_GAMEPAD not enabled.
     1913gamepad/
     1914
    19121915# MutationObservers are net yet enabled. http://webkit.org/b/68729
    19131916fast/mutation
  • trunk/LayoutTests/platform/gtk/Skipped

    r100817 r100833  
    258258fast/forms/time
    259259fast/forms/week
     260
     261# ENABLE_GAMEPAD not enabled.
     262gamepad/
    260263
    261264# Speech input is not yet enabled.
  • trunk/LayoutTests/platform/mac/Skipped

    r100688 r100833  
    215215fast/forms/week
    216216
     217# ENABLE_GAMEPAD not enabled.
     218gamepad/
     219
    217220# Speech input is not yet enabled.
    218221fast/speech
  • trunk/LayoutTests/platform/qt/Skipped

    r100763 r100833  
    8989fast/forms/time
    9090fast/forms/week
     91
     92# ENABLE_GAMEPAD not enabled.
     93gamepad/
    9194
    9295# ENABLE(INPUT_SPEECH) is disabled.
  • trunk/LayoutTests/platform/win/Skipped

    r100381 r100833  
    11231123fast/forms/week
    11241124
     1125# ENABLE_GAMEPAD not enabled.
     1126gamepad/
     1127
    11251128# Speech input is not yet enabled.
    11261129fast/speech
  • trunk/LayoutTests/platform/wincairo/Skipped

    r100338 r100833  
    16401640fast/forms/week
    16411641
     1642# ENABLE_GAMEPAD not enabled.
     1643gamepad/
     1644
    16421645# Speech input is not yet enabled.
    16431646fast/speech
  • trunk/Source/WebCore/ChangeLog

    r100832 r100833  
     12011-11-18  Scott Graham  <scottmg@chromium.org>
     2
     3        IDL changes for gamepad support
     4        https://bugs.webkit.org/show_bug.cgi?id=71753
     5
     6        Reviewed by Adam Barth.
     7
     8        IDL changes and associated plumbing to expose list of gamepad objects
     9        on navigator object (per current spec). Full patch is
     10        https://bugs.webkit.org/show_bug.cgi?id=69451. Only basic existence
     11        test until more plumbing in future patches.
     12
     13        Test: gamepad/gamepad-api.html
     14
     15        * WebCore.gypi:
     16        * bindings/generic/RuntimeEnabledFeatures.h:
     17        (WebCore::RuntimeEnabledFeatures::setWebkitGamepadsEnabled):
     18        (WebCore::RuntimeEnabledFeatures::webkitGamepadsEnabled):
     19        * page/Gamepad.cpp: Added.
     20        (WebCore::Gamepad::Gamepad):
     21        (WebCore::Gamepad::axes):
     22        (WebCore::Gamepad::buttons):
     23        (WebCore::Gamepad::~Gamepad):
     24        * page/Gamepad.h: Added.
     25        * page/Gamepad.idl: Added.
     26        * page/GamepadList.cpp: Added.
     27        (WebCore::GamepadList::~GamepadList):
     28        (WebCore::GamepadList::set):
     29        (WebCore::GamepadList::length):
     30        (WebCore::GamepadList::item):
     31        * page/GamepadList.h: Added.
     32        (WebCore::GamepadList::create):
     33        (WebCore::GamepadList::GamepadList):
     34        * page/GamepadList.idl: Added.
     35        * page/Navigator.cpp:
     36        (WebCore::Navigator::webkitGamepads):
     37        * page/Navigator.h:
     38        * page/Navigator.idl:
     39
    1402011-11-18  Sheriff Bot  <webkit.review.bot@gmail.com>
    241
  • trunk/Source/WebCore/WebCore.gypi

    r100737 r100833  
    14031403            'page/DOMWindow.idl',
    14041404            'page/EventSource.idl',
     1405            'page/Gamepad.idl',
     1406            'page/GamepadList.idl',
    14051407            'page/Geolocation.idl',
    14061408            'page/Geoposition.idl',
     
    29502952            'page/FrameTree.cpp',
    29512953            'page/FrameView.cpp',
     2954            'page/Gamepad.cpp',
     2955            'page/Gamepad.h',
     2956            'page/GamepadList.cpp',
     2957            'page/GamepadList.h',
    29522958            'page/Geolocation.cpp',
    29532959            'page/GeolocationController.cpp',
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r100366 r100833  
    173173
    174174#if ENABLE(GAMEPAD)
    175     static void setGamepadsEnabled(bool isEnabled) { isGamepadEnabled = isEnabled; }
    176     static bool gamepadsEnabled() { return isGamepadEnabled; }
     175    static void setWebkitGamepadsEnabled(bool isEnabled) { isGamepadEnabled = isEnabled; }
     176    static bool webkitGamepadsEnabled() { return isGamepadEnabled; }
    177177#endif
    178178
  • trunk/Source/WebCore/page/Navigator.cpp

    r100555 r100833  
    3333#include "FrameLoader.h"
    3434#include "FrameLoaderClient.h"
     35#include "GamepadList.h"
    3536#include "Geolocation.h"
    3637#include "PointerLock.h"
     
    305306#endif
    306307
     308#if ENABLE(GAMEPAD)
     309GamepadList* Navigator::webkitGamepads()
     310{
     311    // Stubbed until platform/ changes landed.
     312    return 0;
     313}
     314#endif
     315
    307316} // namespace WebCore
  • trunk/Source/WebCore/page/Navigator.h

    r100328 r100833  
    3232class DOMPluginArray;
    3333class Frame;
     34class GamepadList;
    3435class Geolocation;
    3536class PointerLock;
     
    7576#endif
    7677
     78#if ENABLE(GAMEPAD)
     79    GamepadList* webkitGamepads();
     80#endif
     81
    7782private:
    7883    Navigator(Frame*);
  • trunk/Source/WebCore/page/Navigator.idl

    r100328 r100833  
    6262            raises(DOMException);
    6363#endif
     64
     65        readonly attribute [Conditional=GAMEPAD, EnabledAtRuntime] GamepadList webkitGamepads;
    6466    };
    6567
  • trunk/Source/WebKit/chromium/ChangeLog

    r100828 r100833  
     12011-11-18  Scott Graham  <scottmg@chromium.org>
     2
     3        IDL changes for gamepad support
     4        https://bugs.webkit.org/show_bug.cgi?id=71753
     5
     6        Reviewed by Adam Barth.
     7
     8        Update to use vendor-prefixed enable.
     9
     10        * src/WebRuntimeFeatures.cpp:
     11        (WebKit::WebRuntimeFeatures::enableGamepad):
     12        (WebKit::WebRuntimeFeatures::isGamepadEnabled):
     13
    1142011-11-18  Daniel Cheng  <dcheng@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp

    r100306 r100833  
    418418{
    419419#if ENABLE(GAMEPAD)
    420     RuntimeEnabledFeatures::setGamepadsEnabled(enable);
     420    RuntimeEnabledFeatures::setWebkitGamepadsEnabled(enable);
    421421#else
    422422    UNUSED_PARAM(enable);
     
    427427{
    428428#if ENABLE(GAMEPAD)
    429     return RuntimeEnabledFeatures::gamepadsEnabled();
     429    return RuntimeEnabledFeatures::webkitGamepadsEnabled();
    430430#else
    431431    return false;
  • trunk/Tools/ChangeLog

    r100821 r100833  
     12011-11-18  Scott Graham  <scottmg@chromium.org>
     2
     3        IDL changes for gamepad support
     4        https://bugs.webkit.org/show_bug.cgi?id=71753
     5
     6        Reviewed by Adam Barth.
     7
     8        Runtime enable gamepad in chromium test shell.
     9
     10        * DumpRenderTree/chromium/TestShell.cpp:
     11        (TestShell::TestShell):
     12
    1132011-10-27  Darin Fisher  <darin@chromium.org>
    214
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r100533 r100833  
    123123    WebRuntimeFeatures::enableWebAudio(true);
    124124    WebRuntimeFeatures::enableVideoTrack(true);
     125    WebRuntimeFeatures::enableGamepad(true);
    125126
    126127    m_webPermissions = adoptPtr(new WebPermissions(this));
Note: See TracChangeset for help on using the changeset viewer.