Changeset 64845 in webkit


Ignore:
Timestamp:
Aug 6, 2010 6:38:04 AM (14 years ago)
Author:
dino@apple.com
Message:

2010-08-06 Dean Jackson <dino@apple.com>

Reviewed by Simon Fraser and Steve Block.

https://bugs.webkit.org/show_bug.cgi?id=42865
Implement DeviceMotionEvent

Implement the DeviceMotionEvent interface as defined
in http://dev.w3.org/geo/api/spec-source-orientation.html
This is currently an empty implementation, in that there is
no motion client connected - the platform implementations
will need to do that.

Tests: fast/dom/DeviceMotion/create-event.html

fast/dom/DeviceMotion/optional-event-properties.html
fast/dom/DeviceMotion/window-property.html

  • Android.derived.jscbindings.mk:
  • Android.derived.v8bindings.mk:
  • Android.jscbindings.mk:
  • Android.mk:
  • Android.v8bindings.mk:
  • CMakeLists.txt:
  • Configurations/FeatureDefines.xcconfig:
  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
    • Add new files for DeviceMotionEvent build support
  • bindings/generic/RuntimeEnabledFeatures.cpp:
  • bindings/generic/RuntimeEnabledFeatures.h:
    • new runtime flags for device motion
  • bindings/js/JSDeviceMotionEventCustom.cpp: Added.
  • bindings/v8/custom/V8DeviceMotionEventCustom.cpp: Added.
    • Custom JS binding to translate property access through to the DeviceMotionData object that the Event holds
  • bindings/js/JSEventCustom.cpp:
    • Include the custom code for DeviceMotionEvent
  • dom/DeviceMotionClient.h: Added.
    • Pure virtual client for DeviceMotion access
  • dom/DeviceMotionController.cpp: Added.
  • dom/DeviceMotionController.h: Added.
    • Controller class that manages event dispatch
  • dom/DeviceMotionData.cpp: Added.
  • dom/DeviceMotionData.h: Added.
    • Representation of the data that comes from a device motion client that is then used within the event.
  • dom/DeviceMotionEvent.cpp: Added.
  • dom/DeviceMotionEvent.h: Added.
  • dom/DeviceMotionEvent.idl: Added.
    • The actual event implementation
  • dom/Document.cpp: (WebCore::Document::createEvent):
    • Update createEvent to allow "devicemotion" events
  • dom/Event.cpp:
  • dom/Event.h:
    • isDeviceMotionEvent virtual method
  • dom/EventNames.h:
    • new "devicemotion" event type
  • page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener):
  • page/DOMWindow.h:
  • page/DOMWindow.idl:
    • allow creation of "devicemotion" events and pass registration through to the Page's deviceMotionController object
  • page/Page.cpp:
  • page/Page.h:
    • new PageClient for deviceMotionController

Layout Tests:

  • fast/dom/Window/window-properties-device-orientation-expected.txt:
  • fast/dom/Window/window-properties-device-orientation.html:
  • fast/dom/Window/window-properties.html:

Add some tests for the DeviceMotionEvent interface.

  • fast/dom/DeviceMotion/create-event-expected.txt: Added.
  • fast/dom/DeviceMotion/create-event.html: Added.
  • fast/dom/DeviceMotion/optional-event-properties-expected.txt: Added.
  • fast/dom/DeviceMotion/optional-event-properties.html: Added.
  • fast/dom/DeviceMotion/script-tests/TEMPLATE.html: Added.
  • fast/dom/DeviceMotion/script-tests/create-event.js: Added.
  • fast/dom/DeviceMotion/script-tests/optional-event-properties.js: Added.
  • fast/dom/DeviceMotion/script-tests/window-property.js: Added.
  • fast/dom/DeviceMotion/window-property-expected.txt: Added.
  • fast/dom/DeviceMotion/window-property.html: Added.

Make sure these are skipped on Mac, Win, GTK and QT.

  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
Location:
trunk
Files:
22 added
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64840 r64845  
     12010-08-06  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Simon Fraser and Steve Block
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=42865
     6        Implement DeviceMotionEvent
     7
     8        Add DeviceMotion and ondevicemotion testing to
     9        the device-orientation test, and make sure the DeviceMotion
     10        interface is not tested in the generic window object.
     11
     12        * fast/dom/Window/window-properties-device-orientation-expected.txt:
     13        * fast/dom/Window/window-properties-device-orientation.html:
     14        * fast/dom/Window/window-properties.html:
     15
     16        Add some tests for the DeviceMotionEvent interface.
     17
     18        * fast/dom/DeviceMotion/create-event-expected.txt: Added.
     19        * fast/dom/DeviceMotion/create-event.html: Added.
     20        * fast/dom/DeviceMotion/optional-event-properties-expected.txt: Added.
     21        * fast/dom/DeviceMotion/optional-event-properties.html: Added.
     22        * fast/dom/DeviceMotion/script-tests/TEMPLATE.html: Added.
     23        * fast/dom/DeviceMotion/script-tests/create-event.js: Added.
     24        * fast/dom/DeviceMotion/script-tests/optional-event-properties.js: Added.
     25        * fast/dom/DeviceMotion/script-tests/window-property.js: Added.
     26        * fast/dom/DeviceMotion/window-property-expected.txt: Added.
     27        * fast/dom/DeviceMotion/window-property.html: Added.
     28
     29        Make sure these are skipped on Mac, Win, GTK and QT.
     30
     31        * platform/gtk/Skipped:
     32        * platform/mac/Skipped:
     33        * platform/qt/Skipped:
     34        * platform/win/Skipped:
     35
    1362010-08-06  Pavel Feldman  <pfeldman@chromium.org>
    237
  • trunk/LayoutTests/fast/dom/Window/window-properties-device-orientation-expected.txt

    r62653 r64845  
    11This test dumps all of the properties that are reachable from the window.DeviceOrientationEvent and window.ondeviceorientation objects, along with their types.
    22
     3window.DeviceMotionEvent [function]
     4window.ondevicemotion [null]
    35window.DeviceOrientationEvent [function]
    46window.ondeviceorientation [null]
  • trunk/LayoutTests/fast/dom/Window/window-properties-device-orientation.html

    r62653 r64845  
    1 <p>This test dumps all of the properties that are reachable from the window.DeviceOrientationEvent and window.ondeviceorientation objects, along with their types.</p>
     1<p>This test dumps all of the properties that are reachable from the window.DeviceMotionEvent window.ondevicemotion, window.DeviceOrientationEvent and window.ondeviceorientation objects, along with their types.
     2  These properties are currently guarded by ENABLE_DEVICE_ORIENTATION.</p>
    23<hr>
    34<pre id="pre"></pre>
     
    8990}
    9091
     92logValue('window.DeviceMotionEvent');
     93logValue('window.ondevicemotion');
    9194logValue('window.DeviceOrientationEvent');
    9295logValue('window.ondeviceorientation');
  • trunk/LayoutTests/fast/dom/Window/window-properties.html

    r64766 r64845  
    8787    "window.DeviceOrientationEvent" : 1,
    8888    "window.ondeviceorientation" : 1,
     89    "window.DeviceMotionEvent" : 1,
     90    "window.ondevicemotion" : 1,
    8991    "window.webkitPerformance" : 1,
    9092
  • trunk/LayoutTests/platform/gtk/Skipped

    r64815 r64845  
    10821082fast/dom/cssTarget-crash.html
    10831083fast/dom/frame-loading-via-document-write.html
     1084fast/dom/DeviceMotion/create-event.html
     1085fast/dom/DeviceMotion/optional-event-properties.html
     1086fast/dom/DeviceMotion/window-property.html
    10841087fast/dom/DeviceOrientation/basic-operation.html
    10851088fast/dom/DeviceOrientation/create-event.html
  • trunk/LayoutTests/platform/mac/Skipped

    r64434 r64845  
    241241storage/indexeddb
    242242
    243 # This port doesn't support DeviceOrientation.
     243# This port doesn't support DeviceMotion or DeviceOrientation.
     244fast/dom/DeviceMotion
    244245fast/dom/DeviceOrientation
    245246fast/dom/Window/window-properties-device-orientation.html
  • trunk/LayoutTests/platform/qt/Skipped

    r64766 r64845  
    7979# =========================================================================== #
    8080
    81 # This port doesn't support DeviceOrientation.
     81# This port doesn't support DeviceMotion or DeviceOrientation.
     82fast/dom/DeviceMotion
    8283fast/dom/DeviceOrientation
    8384fast/dom/Window/window-properties-device-orientation.html
  • trunk/LayoutTests/platform/win/Skipped

    r64766 r64845  
    875875storage/indexeddb
    876876
    877 # This port doesn't support DeviceOrientation.
     877# This port doesn't support DeviceMotion or DeviceOrientation.
     878fast/dom/DeviceMotion
    878879fast/dom/DeviceOrientation
    879880fast/dom/Window/window-properties-device-orientation.html
  • trunk/WebCore/Android.derived.jscbindings.mk

    r64828 r64845  
    106106    $(intermediates)/dom/JSDOMImplementation.h \
    107107    $(intermediates)/dom/JSDOMStringList.h \
     108    $(intermediates)/dom/JSDeviceMotionEvent.h \
    108109    $(intermediates)/dom/JSDeviceOrientationEvent.h \
    109110    $(intermediates)/dom/JSDocument.h \
  • trunk/WebCore/Android.derived.v8bindings.mk

    r64828 r64845  
    8787    $(intermediates)/bindings/V8DOMImplementation.h \
    8888    $(intermediates)/bindings/V8DOMStringList.h \
     89    $(intermediates)/bindings/V8DeviceMotionEvent.h \
    8990    $(intermediates)/bindings/V8DeviceOrientationEvent.h \
    9091    $(intermediates)/bindings/V8Document.h \
  • trunk/WebCore/Android.jscbindings.mk

    r64840 r64845  
    9494        bindings/js/JSDedicatedWorkerContextCustom.cpp \
    9595        bindings/js/JSDesktopNotificationsCustom.cpp \
     96        bindings/js/JSDeviceMotionEventCustom.cpp \
    9697        bindings/js/JSDeviceOrientationEventCustom.cpp \
    9798        bindings/js/JSDocumentCustom.cpp \
  • trunk/WebCore/Android.mk

    r64828 r64845  
    118118        dom/DOMStringList.cpp \
    119119        dom/DecodedDataDocumentParser.cpp \
     120        dom/DeviceMotionController.cpp \
     121        dom/DeviceMotionData.cpp \
     122        dom/DeviceMotionEvent.cpp \
    120123        dom/Document.cpp \
    121124        dom/DocumentFragment.cpp \
  • trunk/WebCore/Android.v8bindings.mk

    r64840 r64845  
    109109        bindings/v8/custom/V8DatabaseCustom.cpp \
    110110        bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
     111        bindings/v8/custom/V8DeviceMotionEventCustom.cpp \
    111112        bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
    112113        bindings/v8/custom/V8DocumentCustom.cpp \
  • trunk/WebCore/CMakeLists.txt

    r64840 r64845  
    145145    dom/CompositionEvent.idl
    146146    dom/CustomEvent.idl
     147    dom/DeviceMotionEvent.idl
    147148    dom/DeviceOrientationEvent.idl
    148149    dom/DocumentFragment.idl
     
    597598    bindings/js/JSDebugWrapperSet.cpp
    598599    bindings/js/JSDedicatedWorkerContextCustom.cpp
     600    bindings/js/JSDeviceMotionEventCustom.cpp
    599601    bindings/js/JSDeviceOrientationEventCustom.cpp
    600602    bindings/js/JSDocumentCustom.cpp
     
    792794    dom/DatasetDOMStringMap.cpp
    793795    dom/DecodedDataDocumentParser.cpp
     796    dom/DeviceMotionController.cpp
     797    dom/DeviceMotionData.cpp
     798    dom/DeviceMotionEvent.cpp
    794799    dom/DeviceOrientation.cpp
    795800    dom/DeviceOrientationController.cpp
  • trunk/WebCore/ChangeLog

    r64844 r64845  
     12010-08-06  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Simon Fraser and Steve Block.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=42865
     6        Implement DeviceMotionEvent
     7
     8        Implement the DeviceMotionEvent interface as defined
     9        in http://dev.w3.org/geo/api/spec-source-orientation.html
     10        This is currently an empty implementation, in that there is
     11        no motion client connected - the platform implementations
     12        will need to do that.
     13
     14        Tests: fast/dom/DeviceMotion/create-event.html
     15               fast/dom/DeviceMotion/optional-event-properties.html
     16               fast/dom/DeviceMotion/window-property.html
     17
     18        * Android.derived.jscbindings.mk:
     19        * Android.derived.v8bindings.mk:
     20        * Android.jscbindings.mk:
     21        * Android.mk:
     22        * Android.v8bindings.mk:
     23        * CMakeLists.txt:
     24        * Configurations/FeatureDefines.xcconfig:
     25        * DerivedSources.make:
     26        * GNUmakefile.am:
     27        * WebCore.gypi:
     28        * WebCore.pro:
     29        * WebCore.vcproj/WebCore.vcproj:
     30        * WebCore.xcodeproj/project.pbxproj:
     31          - Add new files for DeviceMotionEvent build support
     32        * bindings/generic/RuntimeEnabledFeatures.cpp:
     33        * bindings/generic/RuntimeEnabledFeatures.h:
     34          - new runtime flags for device motion
     35        * bindings/js/JSDeviceMotionEventCustom.cpp: Added.
     36        * bindings/v8/custom/V8DeviceMotionEventCustom.cpp: Added.
     37          - Custom JS binding to translate property access through
     38            to the DeviceMotionData object that the Event holds
     39        * bindings/js/JSEventCustom.cpp:
     40          - Include the custom code for DeviceMotionEvent
     41        * dom/DeviceMotionClient.h: Added.
     42          - Pure virtual client for DeviceMotion access
     43        * dom/DeviceMotionController.cpp: Added.
     44        * dom/DeviceMotionController.h: Added.
     45          - Controller class that manages event dispatch
     46        * dom/DeviceMotionData.cpp: Added.
     47        * dom/DeviceMotionData.h: Added.
     48          - Representation of the data that comes from a device motion
     49            client that is then used within the event.
     50        * dom/DeviceMotionEvent.cpp: Added.
     51        * dom/DeviceMotionEvent.h: Added.
     52        * dom/DeviceMotionEvent.idl: Added.
     53          - The actual event implementation
     54        * dom/Document.cpp:
     55        (WebCore::Document::createEvent):
     56          - Update createEvent to allow "devicemotion" events
     57        * dom/Event.cpp:
     58        * dom/Event.h:
     59          - isDeviceMotionEvent virtual method
     60        * dom/EventNames.h:
     61          - new "devicemotion" event type
     62        * page/DOMWindow.cpp:
     63        (WebCore::DOMWindow::addEventListener):
     64        * page/DOMWindow.h:
     65        * page/DOMWindow.idl:
     66          - allow creation of "devicemotion" events and pass registration
     67            through to the Page's deviceMotionController object
     68        * page/Page.cpp:
     69        * page/Page.h:
     70          - new PageClient for deviceMotionController
     71
    1722010-08-06  Kavita Kanetkar  <kkanetkar@chromium.org>
    273
  • trunk/WebCore/DerivedSources.make

    r64828 r64845  
    128128    DatabaseCallback \
    129129    DatabaseSync \
     130    DeviceMotionEvent \
    130131    DeviceOrientationEvent \
    131132    Document \
  • trunk/WebCore/GNUmakefile.am

    r64840 r64845  
    182182        DerivedSources/WebCore/JSDedicatedWorkerContext.cpp \
    183183        DerivedSources/WebCore/JSDedicatedWorkerContext.h \
     184        DerivedSources/WebCore/JSDeviceMotionEvent.cpp \
     185        DerivedSources/WebCore/JSDeviceMotionEvent.h \
    184186        DerivedSources/WebCore/JSDeviceOrientationEvent.cpp \
    185187        DerivedSources/WebCore/JSDeviceOrientationEvent.h \
     
    672674        WebCore/bindings/js/JSDOMWrapper.cpp \
    673675        WebCore/bindings/js/JSDOMWrapper.h \
     676        WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
    674677        WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
    675678        WebCore/bindings/js/JSDocumentCustom.cpp \
     
    10201023        WebCore/dom/DecodedDataDocumentParser.cpp \
    10211024        WebCore/dom/DecodedDataDocumentParser.h \
     1025        WebCore/dom/DeviceMotionClient.h \
     1026        WebCore/dom/DeviceMotionController.cpp \
     1027        WebCore/dom/DeviceMotionController.h \
     1028        WebCore/dom/DeviceMotionData.cpp \
     1029        WebCore/dom/DeviceMotionData.h \
     1030        WebCore/dom/DeviceMotionEvent.cpp \
     1031        WebCore/dom/DeviceMotionEvent.h \
    10221032        WebCore/dom/DeviceOrientation.cpp \
    10231033        WebCore/dom/DeviceOrientation.h \
  • trunk/WebCore/WebCore.exp.in

    r64803 r64845  
    406406__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
    407407__ZN7WebCore17DOMImplementation14isTextMIMETypeERKNS_6StringE
     408__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
    408409__ZN7WebCore17DeviceOrientation6createEbdbdbd
    409410__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
  • trunk/WebCore/WebCore.gypi

    r64840 r64845  
    4444            'dom/DOMStringList.idl',
    4545            'dom/DOMStringMap.idl',
     46            'dom/DeviceMotionEvent.idl',
    4647            'dom/DeviceOrientationEvent.idl',
    4748            'dom/Document.idl',
     
    551552            'bindings/js/JSDebugWrapperSet.cpp',
    552553            'bindings/js/JSDebugWrapperSet.h',
     554            'bindings/js/JSDeviceMotionEventCustom.cpp',
    553555            'bindings/js/JSDeviceOrientationEventCustom.cpp',
    554556            'bindings/js/JSDocumentCustom.cpp',
     
    745747            'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
    746748            'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
     749            'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
    747750            'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
    748751            'bindings/v8/custom/V8DocumentLocationCustom.cpp',
     
    11261129            'dom/DecodedDataDocumentParser.cpp',
    11271130            'dom/DecodedDataDocumentParser.h',
     1131            'dom/DeviceMotionClient.h',
     1132            'dom/DeviceMotionController.cpp',
     1133            'dom/DeviceMotionController.h',
     1134            'dom/DeviceMotionData.cpp',
     1135            'dom/DeviceMotionData.h',
     1136            'dom/DeviceMotionEvent.cpp',
     1137            'dom/DeviceMotionEvent.h',
    11281138            'dom/DeviceOrientation.cpp',
    11291139            'dom/DeviceOrientation.h',
  • trunk/WebCore/WebCore.pri

    r64828 r64845  
    294294    dom/CompositionEvent.idl \
    295295    dom/CustomEvent.idl \
     296    dom/DeviceMotionEvent.idl \
    296297    dom/DeviceOrientationEvent.idl \
    297298    dom/DocumentFragment.idl \
  • trunk/WebCore/WebCore.pro

    r64840 r64845  
    302302    bindings/js/JSDebugWrapperSet.cpp \
    303303    bindings/js/JSDesktopNotificationsCustom.cpp \
     304    bindings/js/JSDeviceMotionEventCustom.cpp \
    304305    bindings/js/JSDeviceOrientationEventCustom.cpp \
    305306    bindings/js/JSDocumentCustom.cpp \
     
    479480    dom/CustomEvent.cpp \
    480481    dom/DecodedDataDocumentParser.cpp \
     482    dom/DeviceMotionController.cpp \
     483    dom/DeviceMotionData.cpp \
     484    dom/DeviceMotionEvent.cpp \
    481485    dom/DeviceOrientation.cpp \
    482486    dom/DeviceOrientationController.cpp \
     
    12421246    dom/CustomEvent.h \
    12431247    dom/default/PlatformMessagePortChannel.h \
     1248    dom/DeviceMotionClient.h \
     1249    dom/DeviceMotionData.h \
     1250    dom/DeviceMotionController.h \
     1251    dom/DeviceMotionEvent.h \
    12441252    dom/DeviceOrientation.h \
    12451253    dom/DeviceOrientationClient.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r64840 r64845  
    29062906                        </File>
    29072907                        <File
     2908                                RelativePath="$(WebKitOutputDir)\obj\WebCore\DerivedSources\JSDeviceMotionEvent.cpp"
     2909                                >
     2910                                <FileConfiguration
     2911                                        Name="Debug|Win32"
     2912                                        ExcludedFromBuild="true"
     2913                                        >
     2914                                        <Tool
     2915                                                Name="VCCLCompilerTool"
     2916                                        />
     2917                                </FileConfiguration>
     2918                                <FileConfiguration
     2919                                        Name="Release|Win32"
     2920                                        ExcludedFromBuild="true"
     2921                                        >
     2922                                        <Tool
     2923                                                Name="VCCLCompilerTool"
     2924                                        />
     2925                                </FileConfiguration>
     2926                                <FileConfiguration
     2927                                        Name="Debug_Internal|Win32"
     2928                                        ExcludedFromBuild="true"
     2929                                        >
     2930                                        <Tool
     2931                                                Name="VCCLCompilerTool"
     2932                                        />
     2933                                </FileConfiguration>
     2934                                <FileConfiguration
     2935                                        Name="Debug_Cairo|Win32"
     2936                                        ExcludedFromBuild="true"
     2937                                        >
     2938                                        <Tool
     2939                                                Name="VCCLCompilerTool"
     2940                                        />
     2941                                </FileConfiguration>
     2942                                <FileConfiguration
     2943                                        Name="Release_Cairo|Win32"
     2944                                        ExcludedFromBuild="true"
     2945                                        >
     2946                                        <Tool
     2947                                                Name="VCCLCompilerTool"
     2948                                        />
     2949                                </FileConfiguration>
     2950                                <FileConfiguration
     2951                                        Name="Debug_All|Win32"
     2952                                        ExcludedFromBuild="true"
     2953                                        >
     2954                                        <Tool
     2955                                                Name="VCCLCompilerTool"
     2956                                        />
     2957                                </FileConfiguration>
     2958                        </File>
     2959                        <File
     2960                                RelativePath="$(WebKitOutputDir)\obj\WebCore\DerivedSources\JSDeviceMotionEvent.h"
     2961                                >
     2962                        </File>
     2963                        <File
    29082964                                RelativePath="$(WebKitOutputDir)\obj\WebCore\DerivedSources\JSDeviceOrientationEvent.cpp"
    29092965                                >
     
    3265432710                        </File>
    3265532711                        <File
     32712                                RelativePath="..\dom\DeviceMotionClient.h"
     32713                                >
     32714                        </File>
     32715                        <File
     32716                                RelativePath="..\dom\DeviceMotionController.cpp"
     32717                                >
     32718                        </File>
     32719                        <File
     32720                                RelativePath="..\dom\DeviceMotionController.h"
     32721                                >
     32722                        </File>
     32723                        <File
     32724                                RelativePath="..\dom\DeviceMotionData.cpp"
     32725                                >
     32726                        </File>
     32727                        <File
     32728                                RelativePath="..\dom\DeviceMotionData.h"
     32729                                >
     32730                        </File>
     32731                        <File
     32732                                RelativePath="..\dom\DeviceMotionEvent.cpp"
     32733                                >
     32734                        </File>
     32735                        <File
     32736                                RelativePath="..\dom\DeviceMotionEvent.h"
     32737                                >
     32738                        </File>
     32739                        <File
    3265632740                                RelativePath="..\dom\DeviceOrientation.cpp"
    3265732741                                >
     
    4239842482                                <File
    4239942483                                        RelativePath="..\bindings\js\JSDesktopNotificationsCustom.cpp"
     42484                                        >
     42485                                        <FileConfiguration
     42486                                                Name="Debug|Win32"
     42487                                                ExcludedFromBuild="true"
     42488                                                >
     42489                                                <Tool
     42490                                                        Name="VCCLCompilerTool"
     42491                                                />
     42492                                        </FileConfiguration>
     42493                                        <FileConfiguration
     42494                                                Name="Release|Win32"
     42495                                                ExcludedFromBuild="true"
     42496                                                >
     42497                                                <Tool
     42498                                                        Name="VCCLCompilerTool"
     42499                                                />
     42500                                        </FileConfiguration>
     42501                                        <FileConfiguration
     42502                                                Name="Debug_Internal|Win32"
     42503                                                ExcludedFromBuild="true"
     42504                                                >
     42505                                                <Tool
     42506                                                        Name="VCCLCompilerTool"
     42507                                                />
     42508                                        </FileConfiguration>
     42509                                        <FileConfiguration
     42510                                                Name="Debug_Cairo|Win32"
     42511                                                ExcludedFromBuild="true"
     42512                                                >
     42513                                                <Tool
     42514                                                        Name="VCCLCompilerTool"
     42515                                                />
     42516                                        </FileConfiguration>
     42517                                        <FileConfiguration
     42518                                                Name="Release_Cairo|Win32"
     42519                                                ExcludedFromBuild="true"
     42520                                                >
     42521                                                <Tool
     42522                                                        Name="VCCLCompilerTool"
     42523                                                />
     42524                                        </FileConfiguration>
     42525                                        <FileConfiguration
     42526                                                Name="Debug_All|Win32"
     42527                                                ExcludedFromBuild="true"
     42528                                                >
     42529                                                <Tool
     42530                                                        Name="VCCLCompilerTool"
     42531                                                />
     42532                                        </FileConfiguration>
     42533                                </File>
     42534                                <File
     42535                                        RelativePath="..\bindings\js\JSDeviceMotionEventCustom.cpp"
    4240042536                                        >
    4240142537                                        <FileConfiguration
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r64840 r64845  
    751751                31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
    752752                31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
     753                31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */; };
     754                31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A50120A5D0600DC02A0 /* DeviceMotionController.cpp */; };
     755                31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A51120A5D0600DC02A0 /* DeviceMotionController.h */; };
     756                31FB1A5A120A5D0600DC02A0 /* DeviceMotionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A52120A5D0600DC02A0 /* DeviceMotionData.cpp */; };
     757                31FB1A5B120A5D0600DC02A0 /* DeviceMotionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A53120A5D0600DC02A0 /* DeviceMotionData.h */; };
     758                31FB1A5C120A5D0600DC02A0 /* DeviceMotionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A54120A5D0600DC02A0 /* DeviceMotionEvent.cpp */; };
     759                31FB1A5D120A5D0600DC02A0 /* DeviceMotionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A55120A5D0600DC02A0 /* DeviceMotionEvent.h */; };
     760                31FB1A65120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */; };
     761                31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */; };
     762                31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */; };
    753763                3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */; };
    754764                3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3314ACEA10892086000F0E56 /* JSExceptionBase.h */; };
     
    64806490                31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitTransitionEvent.mm; sourceTree = "<group>"; };
    64816491                31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
     6492                31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionClient.h; sourceTree = "<group>"; };
     6493                31FB1A50120A5D0600DC02A0 /* DeviceMotionController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionController.cpp; sourceTree = "<group>"; };
     6494                31FB1A51120A5D0600DC02A0 /* DeviceMotionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionController.h; sourceTree = "<group>"; };
     6495                31FB1A52120A5D0600DC02A0 /* DeviceMotionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionData.cpp; sourceTree = "<group>"; };
     6496                31FB1A53120A5D0600DC02A0 /* DeviceMotionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionData.h; sourceTree = "<group>"; };
     6497                31FB1A54120A5D0600DC02A0 /* DeviceMotionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionEvent.cpp; sourceTree = "<group>"; };
     6498                31FB1A55120A5D0600DC02A0 /* DeviceMotionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionEvent.h; sourceTree = "<group>"; };
     6499                31FB1A56120A5D0600DC02A0 /* DeviceMotionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceMotionEvent.idl; sourceTree = "<group>"; };
     6500                31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEvent.cpp; sourceTree = "<group>"; };
     6501                31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDeviceMotionEvent.h; sourceTree = "<group>"; };
     6502                31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEventCustom.cpp; sourceTree = "<group>"; };
    64826503                3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
    64836504                3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
     
    1477014791                                FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */,
    1477114792                                FE6FD48C0F676E9300092873 /* JSCoordinates.h */,
     14793                                31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */,
     14794                                31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */,
    1477214795                                59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */,
    1477314796                                59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */,
     
    1595515978                                4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
    1595615979                                33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
     15980                                31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
    1595715981                                590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
    1595815982                                49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
     
    1710517129                                A8C228A011D5722E00D5A7D3 /* DecodedDataDocumentParser.cpp */,
    1710617130                                A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */,
     17131                                31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */,
     17132                                31FB1A50120A5D0600DC02A0 /* DeviceMotionController.cpp */,
     17133                                31FB1A51120A5D0600DC02A0 /* DeviceMotionController.h */,
     17134                                31FB1A52120A5D0600DC02A0 /* DeviceMotionData.cpp */,
     17135                                31FB1A53120A5D0600DC02A0 /* DeviceMotionData.h */,
     17136                                31FB1A54120A5D0600DC02A0 /* DeviceMotionEvent.cpp */,
     17137                                31FB1A55120A5D0600DC02A0 /* DeviceMotionEvent.h */,
     17138                                31FB1A56120A5D0600DC02A0 /* DeviceMotionEvent.idl */,
    1710717139                                59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */,
    1710817140                                590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */,
     
    2003220064                                97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
    2003320065                                CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
     20066                                31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */,
     20067                                31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */,
     20068                                31FB1A5B120A5D0600DC02A0 /* DeviceMotionData.h in Headers */,
     20069                                31FB1A5D120A5D0600DC02A0 /* DeviceMotionEvent.h in Headers */,
     20070                                31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */,
    2003420071                        );
    2003520072                        runOnlyForDeploymentPostprocessing = 0;
     
    2244122478                                E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
    2244222479                                97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
     22480                                31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */,
     22481                                31FB1A5A120A5D0600DC02A0 /* DeviceMotionData.cpp in Sources */,
     22482                                31FB1A5C120A5D0600DC02A0 /* DeviceMotionEvent.cpp in Sources */,
     22483                                31FB1A65120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp in Sources */,
     22484                                31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */,
    2244322485                        );
    2244422486                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp

    r64269 r64845  
    4848bool RuntimeEnabledFeatures::isPushStateEnabled = false;
    4949bool RuntimeEnabledFeatures::isTouchEnabled = true;
     50bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
    5051bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
    5152bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
  • trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r64269 r64845  
    115115#endif
    116116
     117    static void setDeviceMotionEnabled(bool isEnabled) { isDeviceMotionEnabled = isEnabled; }
     118    static bool deviceMotionEnabled() { return isDeviceMotionEnabled; }
     119    static bool deviceMotionEventEnabled() { return isDeviceMotionEnabled; }
     120    static bool ondevicemotionEnabled() { return isDeviceMotionEnabled; }
     121   
    117122    static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
    118123    static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
     
    137142    static bool isPushStateEnabled;
    138143    static bool isTouchEnabled;
     144    static bool isDeviceMotionEnabled;
    139145    static bool isDeviceOrientationEnabled;
    140146    static bool isSpeechInputEnabled;
  • trunk/WebCore/bindings/js/JSEventCustom.cpp

    r60624 r64845  
    3333#include "CompositionEvent.h"
    3434#include "CustomEvent.h"
     35#include "DeviceMotionEvent.h"
    3536#include "DeviceOrientationEvent.h"
    3637#include "Event.h"
     
    3940#include "JSCustomEvent.h"
    4041#include "JSCompositionEvent.h"
     42#include "JSDeviceMotionEvent.h"
    4143#include "JSDeviceOrientationEvent.h"
    4244#include "JSErrorEvent.h"
     
    174176        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CustomEvent, event);
    175177#if ENABLE(DEVICE_ORIENTATION)
     178    else if (event->isDeviceMotionEvent())
     179        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceMotionEvent, event);
    176180    else if (event->isDeviceOrientationEvent())
    177181        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceOrientationEvent, event);
  • trunk/WebCore/dom/Document.cpp

    r64740 r64845  
    4545#include "DOMImplementation.h"
    4646#include "DOMWindow.h"
     47#include "DeviceMotionEvent.h"
    4748#include "DeviceOrientationEvent.h"
    4849#include "DocLoader.h"
     
    33323333#endif
    33333334#if ENABLE(DEVICE_ORIENTATION)
     3335    else if (eventType == "DeviceMotionEvent")
     3336        event = DeviceMotionEvent::create();
    33343337    else if (eventType == "DeviceOrientationEvent")
    33353338        event = DeviceOrientationEvent::create();
  • trunk/WebCore/dom/Event.cpp

    r60624 r64845  
    214214
    215215#if ENABLE(DEVICE_ORIENTATION)
     216bool Event::isDeviceMotionEvent() const
     217{
     218    return false;
     219}
     220
    216221bool Event::isDeviceOrientationEvent() const
    217222{
  • trunk/WebCore/dom/Event.h

    r60624 r64845  
    141141#endif
    142142#if ENABLE(DEVICE_ORIENTATION)
     143        virtual bool isDeviceMotionEvent() const;
    143144        virtual bool isDeviceOrientationEvent() const;
    144145#endif
  • trunk/WebCore/dom/EventNames.h

    r64824 r64845  
    5252    macro(cut) \
    5353    macro(dblclick) \
     54    macro(devicemotion) \
    5455    macro(deviceorientation) \
    5556    macro(display) \
  • trunk/WebCore/page/DOMWindow.cpp

    r64344 r64845  
    4343#include "Database.h"
    4444#include "DatabaseCallback.h"
     45#include "DeviceMotionController.h"
    4546#include "DeviceOrientationController.h"
    4647#include "PageTransitionEvent.h"
     
    14361437        addBeforeUnloadEventListener(this);
    14371438#if ENABLE(DEVICE_ORIENTATION)
     1439    else if (eventType == eventNames().devicemotionEvent && frame() && frame()->page() && frame()->page()->deviceMotionController())
     1440        frame()->page()->deviceMotionController()->addListener(this);
    14381441    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
    14391442        frame()->page()->deviceOrientationController()->addListener(this);
     
    14531456        removeBeforeUnloadEventListener(this);
    14541457#if ENABLE(DEVICE_ORIENTATION)
     1458    else if (eventType == eventNames().devicemotionEvent && frame() && frame()->page() && frame()->page()->deviceMotionController())
     1459        frame()->page()->deviceMotionController()->removeListener(this);
    14551460    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
    14561461        frame()->page()->deviceOrientationController()->removeListener(this);
     
    15311536
    15321537#if ENABLE(DEVICE_ORIENTATION)
     1538    if (frame() && frame()->page() && frame()->page()->deviceMotionController())
     1539        frame()->page()->deviceMotionController()->removeAllListeners(this);
    15331540    if (frame() && frame()->page() && frame()->page()->deviceOrientationController())
    15341541        frame()->page()->deviceOrientationController()->removeAllListeners(this);
  • trunk/WebCore/page/DOMWindow.h

    r64344 r64845  
    339339
    340340#if ENABLE(DEVICE_ORIENTATION)
     341        DEFINE_ATTRIBUTE_EVENT_LISTENER(devicemotion);
    341342        DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
    342343#endif
  • trunk/WebCore/page/DOMWindow.idl

    r64840 r64845  
    306306        attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
    307307
    308         attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
    309         attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] EventListener ondeviceorientation;
     308        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] DeviceMotionEventConstructor DeviceMotionEvent;
     309        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] EventListener ondevicemotion;
     310        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
     311        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] EventListener ondeviceorientation;
    310312
    311313        // EventTarget interface
  • trunk/WebCore/page/Page.cpp

    r64401 r64845  
    2121#include "Page.h"
    2222
     23#include "DeviceMotionController.h"
    2324#include "BackForwardController.h"
    2425#include "BackForwardList.h"
     
    142143#endif
    143144#if ENABLE(DEVICE_ORIENTATION)
     145    , m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)
    144146    , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
    145147#endif
  • trunk/WebCore/page/Page.h

    r64401 r64845  
    4545    class ContextMenuClient;
    4646    class ContextMenuController;
     47    class DeviceMotionClient;
     48    class DeviceMotionController;
    4749    class DeviceOrientationClient;
    4850    class DeviceOrientationController;
     
    102104                , pluginHalterClient(0)
    103105                , geolocationControllerClient(0)
     106                , deviceMotionClient(0)
    104107                , deviceOrientationClient(0)
    105108                , backForwardControllerClient(0)
     
    114117            PluginHalterClient* pluginHalterClient;
    115118            GeolocationControllerClient* geolocationControllerClient;
     119            DeviceMotionClient* deviceMotionClient;
    116120            DeviceOrientationClient* deviceOrientationClient;
    117121            BackForwardControllerClient* backForwardControllerClient;
     
    180184#endif
    181185#if ENABLE(DEVICE_ORIENTATION)
     186        DeviceMotionController* deviceMotionController() const { return m_deviceMotionController.get(); }
    182187        DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
    183188#endif
     
    314319#endif
    315320#if ENABLE(DEVICE_ORIENTATION)
     321        OwnPtr<DeviceMotionController> m_deviceMotionController;
    316322        OwnPtr<DeviceOrientationController> m_deviceOrientationController;
    317323#endif
Note: See TracChangeset for help on using the changeset viewer.