[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

dino at apple.com dino at apple.com
Wed Dec 22 13:43:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 55e107cf4ba6b97ac9ea6ced01c52062b8dd28c4
Author: dino at apple.com <dino at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 24 06:05:56 2010 +0000

    2010-09-23  Hans Wennborg  <hans at chromium.org>
    
            Reviewed by Simon Fraser.
    
            Update DeviceMotionEvent to spec
            https://bugs.webkit.org/show_bug.cgi?id=46344
    
            The spec has changed: the DeviceMotionEvent attributes accelerationX,
            accelerationY, etc. have been baked into an 'acceleration' attribute
            which returns an object with x, y, and z values. Likewise for the
            rotation rate. The 'accelerationIncludingGravity' attribute is new.
    
            * WebCore.exp.in:
            The DeviceMotionData::create member function has changed. Also export
            create functions for DeviceMotionData::Acceleration and RotationRate.
    
            * bindings/js/JSDeviceMotionEventCustom.cpp:
            (WebCore::JSDeviceMotionEvent::acceleration):
            (WebCore::JSDeviceMotionEvent::accelerationIncludingGravity):
            (WebCore::JSDeviceMotionEvent::rotationRate):
            (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
            Manually create and return objects with the right attributes for
            acceleration, accelerationIncludingGravity, and rotationRate.
            When creating the DeviceMotionData object in initDeviceMotionEvent,
            accept any input objects that have the right attributes.
    
            * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
            (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter):
            (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter):
            (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter):
            (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
            V8 counterpart to the JSC code above.
    
            * dom/DeviceMotionData.cpp:
            (WebCore::DeviceMotionData::Acceleration::create):
            (WebCore::DeviceMotionData::Acceleration::Acceleration):
            (WebCore::DeviceMotionData::RotationRate::create):
            (WebCore::DeviceMotionData::RotationRate::RotationRate):
            (WebCore::DeviceMotionData::create):
            (WebCore::DeviceMotionData::DeviceMotionData):
            * dom/DeviceMotionData.h:
            (WebCore::DeviceMotionData::Acceleration::canProvideX):
            (WebCore::DeviceMotionData::Acceleration::canProvideY):
            (WebCore::DeviceMotionData::Acceleration::canProvideZ):
            (WebCore::DeviceMotionData::Acceleration::x):
            (WebCore::DeviceMotionData::Acceleration::y):
            (WebCore::DeviceMotionData::Acceleration::z):
            (WebCore::DeviceMotionData::RotationRate::canProvideAlpha):
            (WebCore::DeviceMotionData::RotationRate::canProvideBeta):
            (WebCore::DeviceMotionData::RotationRate::canProvideGamma):
            (WebCore::DeviceMotionData::RotationRate::alpha):
            (WebCore::DeviceMotionData::RotationRate::beta):
            (WebCore::DeviceMotionData::RotationRate::gamma):
            (WebCore::DeviceMotionData::acceleration):
            (WebCore::DeviceMotionData::accelerationIncludingGravity):
            (WebCore::DeviceMotionData::rotationRate):
            Add member classes Acceleration and RotationRate to DeviceMotionData.
    
            * dom/DeviceMotionEvent.idl:
            Update according to the spec. Acceleration and RotationRate need not
            be backed by native classes.
    
    2010-09-23  Hans Wennborg  <hans at chromium.org>
    
            Reviewed by Simon Fraser.
    
            Update DeviceMotionEvent to spec
            https://bugs.webkit.org/show_bug.cgi?id=46344
    
            * fast/dom/DeviceMotion/script-tests/create-event.js:
            * fast/dom/DeviceMotion/create-event-expected.txt:
            Look for the new attributes.
    
            * fast/dom/DeviceMotion/script-tests/optional-event-properties.js:
            * fast/dom/DeviceMotion/optional-event-properties-expected.txt:
            Test the new attributes.
    
            * fast/dom/script-tests/prototype-inheritance.js:
            DeviceMotionEvent is not implemented on all platforms, so it should be skipped in this test.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9c7aea3..075fa7a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-23  Hans Wennborg  <hans at chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Update DeviceMotionEvent to spec
+        https://bugs.webkit.org/show_bug.cgi?id=46344
+
+        * fast/dom/DeviceMotion/script-tests/create-event.js:
+        * fast/dom/DeviceMotion/create-event-expected.txt:
+        Look for the new attributes.
+
+        * fast/dom/DeviceMotion/script-tests/optional-event-properties.js:
+        * fast/dom/DeviceMotion/optional-event-properties-expected.txt:
+        Test the new attributes.
+
+        * fast/dom/script-tests/prototype-inheritance.js:
+        DeviceMotionEvent is not implemented on all platforms, so it should be skipped in this test.
+
 2010-09-23  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
index fdc40c4..c59edba 100644
--- a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
+++ b/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt
@@ -7,24 +7,17 @@ PASS typeof event == 'object' is true
 PASS 'type' in event is true
 PASS 'bubbles' in event is true
 PASS 'cancelable' in event is true
-PASS 'xAcceleration' in event is true
-PASS 'yAcceleration' in event is true
-PASS 'zAcceleration' in event is true
-PASS 'xRotationRate' in event is true
-PASS 'yRotationRate' in event is true
-PASS 'zRotationRate' in event is true
+PASS 'acceleration' in event is true
+PASS 'accelerationIncludingGravity' in event is true
+PASS 'rotationRate' in event is true
 PASS 'interval' in event is true
 PASS typeof event.type == 'string' is true
 PASS typeof event.bubbles == 'boolean' is true
 PASS typeof event.cancelable == 'boolean' is true
-PASS typeof event.xAcceleration == 'object' is true
-PASS typeof event.yAcceleration == 'object' is true
-PASS typeof event.zAcceleration == 'object' is true
-PASS typeof event.xRotationRate == 'object' is true
-PASS typeof event.yRotationRate == 'object' is true
-PASS typeof event.zRotationRate == 'object' is true
+PASS typeof event.acceleration == 'object' is true
+PASS typeof event.accelerationIncludingGravity == 'object' is true
+PASS typeof event.rotationRate == 'object' is true
 PASS typeof event.interval == 'object' is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
diff --git a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
index 0eabe35..e00875e 100644
--- a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
+++ b/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt
@@ -4,62 +4,57 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 event = document.createEvent('DeviceMotionEvent')
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == null is true
-event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 1 is true
-PASS event.zAcceleration == 2 is true
-PASS event.xRotationRate == 3 is true
-PASS event.yRotationRate == 4 is true
-PASS event.zRotationRate == 5 is true
-PASS event.interval == 6 is true
+event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)
+PASS event.acceleration.x == 0 is true
+PASS event.acceleration.y == 1 is true
+PASS event.acceleration.z == 2 is true
+PASS event.accelerationIncludingGravity.x == 3 is true
+PASS event.accelerationIncludingGravity.y == 4 is true
+PASS event.accelerationIncludingGravity.z == 5 is true
+PASS event.rotationRate.alpha == 6 is true
+PASS event.rotationRate.beta == 7 is true
+PASS event.rotationRate.gamma == 8 is true
+PASS event.interval == 9 is true
+event.initDeviceMotionEvent('', false, false, {y: 1, x: 0}, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)
+PASS event.acceleration.x == 0 is true
+PASS event.acceleration.y == 1 is true
+PASS event.acceleration.z == null is true
+PASS event.accelerationIncludingGravity.x == 3 is true
+PASS event.accelerationIncludingGravity.y == null is true
+PASS event.accelerationIncludingGravity.z == 5 is true
+PASS event.rotationRate.alpha == null is true
+PASS event.rotationRate.beta == 7 is true
+PASS event.rotationRate.gamma == 8 is true
+PASS event.interval == 9 is true
 event.initDeviceMotionEvent()
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == null is true
 event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 0 is true
-PASS event.zAcceleration == 0 is true
-PASS event.xRotationRate == 0 is true
-PASS event.yRotationRate == 0 is true
-PASS event.zRotationRate == 0 is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == 0 is true
 event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == null is true
 event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')
-PASS event.xAcceleration == 0 is true
-PASS event.yAcceleration == 0 is true
-PASS event.zAcceleration == 0 is true
-PASS event.xRotationRate == 0 is true
-PASS event.yRotationRate == 0 is true
-PASS event.zRotationRate == 0 is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == 0 is true
 event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)
-PASS event.xAcceleration == null is true
-PASS event.yAcceleration == null is true
-PASS event.zAcceleration == null is true
-PASS event.xRotationRate == null is true
-PASS event.yRotationRate == null is true
-PASS event.zRotationRate == null is true
+PASS event.acceleration == null is true
+PASS event.accelerationIncludingGravity == null is true
+PASS event.rotationRate == null is true
 PASS event.interval == null is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
index 167329d..8b5aec8 100644
--- a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
@@ -7,23 +7,17 @@ shouldBeTrue("typeof event == 'object'");
 shouldBeTrue("'type' in event");
 shouldBeTrue("'bubbles' in event");
 shouldBeTrue("'cancelable' in event");
-shouldBeTrue("'xAcceleration' in event");
-shouldBeTrue("'yAcceleration' in event");
-shouldBeTrue("'zAcceleration' in event");
-shouldBeTrue("'xRotationRate' in event");
-shouldBeTrue("'yRotationRate' in event");
-shouldBeTrue("'zRotationRate' in event");
+shouldBeTrue("'acceleration' in event");
+shouldBeTrue("'accelerationIncludingGravity' in event");
+shouldBeTrue("'rotationRate' in event");
 shouldBeTrue("'interval' in event");
 
 shouldBeTrue("typeof event.type == 'string'");
 shouldBeTrue("typeof event.bubbles == 'boolean'");
 shouldBeTrue("typeof event.cancelable == 'boolean'");
-shouldBeTrue("typeof event.xAcceleration == 'object'");
-shouldBeTrue("typeof event.yAcceleration == 'object'");
-shouldBeTrue("typeof event.zAcceleration == 'object'");
-shouldBeTrue("typeof event.xRotationRate == 'object'");
-shouldBeTrue("typeof event.yRotationRate == 'object'");
-shouldBeTrue("typeof event.zRotationRate == 'object'");
+shouldBeTrue("typeof event.acceleration == 'object'");
+shouldBeTrue("typeof event.accelerationIncludingGravity == 'object'");
+shouldBeTrue("typeof event.rotationRate == 'object'");
 shouldBeTrue("typeof event.interval == 'object'");
 
 window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
index ab9b53b..c4fc5cb 100644
--- a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
+++ b/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js
@@ -3,66 +3,63 @@ description("Tests the optional properties of DeviceMotionEvent. Each property s
 var event;
 
 evalAndLog("event = document.createEvent('DeviceMotionEvent')");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == null");
 
-evalAndLog("event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 1");
-shouldBeTrue("event.zAcceleration == 2");
-shouldBeTrue("event.xRotationRate == 3");
-shouldBeTrue("event.yRotationRate == 4");
-shouldBeTrue("event.zRotationRate == 5");
-shouldBeTrue("event.interval == 6");
+evalAndLog("event.initDeviceMotionEvent('', false, false, {x: 0, y: 1, z: 2}, {x: 3, y: 4, z: 5}, {alpha: 6, beta: 7, gamma: 8}, 9)");
+shouldBeTrue("event.acceleration.x == 0");
+shouldBeTrue("event.acceleration.y == 1");
+shouldBeTrue("event.acceleration.z == 2");
+shouldBeTrue("event.accelerationIncludingGravity.x == 3");
+shouldBeTrue("event.accelerationIncludingGravity.y == 4");
+shouldBeTrue("event.accelerationIncludingGravity.z == 5");
+shouldBeTrue("event.rotationRate.alpha == 6");
+shouldBeTrue("event.rotationRate.beta == 7");
+shouldBeTrue("event.rotationRate.gamma == 8");
+shouldBeTrue("event.interval == 9");
+
+evalAndLog("event.initDeviceMotionEvent('', false, false, {y: 1, x: 0}, {x: 3, z: 5}, {gamma: 8, beta: 7}, 9)");
+shouldBeTrue("event.acceleration.x == 0");
+shouldBeTrue("event.acceleration.y == 1");
+shouldBeTrue("event.acceleration.z == null");
+shouldBeTrue("event.accelerationIncludingGravity.x == 3");
+shouldBeTrue("event.accelerationIncludingGravity.y == null");
+shouldBeTrue("event.accelerationIncludingGravity.z == 5");
+shouldBeTrue("event.rotationRate.alpha == null");
+shouldBeTrue("event.rotationRate.beta == 7");
+shouldBeTrue("event.rotationRate.gamma == 8");
+shouldBeTrue("event.interval == 9");
 
 evalAndLog("event.initDeviceMotionEvent()");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == null");
 
 evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 0");
-shouldBeTrue("event.zAcceleration == 0");
-shouldBeTrue("event.xRotationRate == 0");
-shouldBeTrue("event.yRotationRate == 0");
-shouldBeTrue("event.zRotationRate == 0");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == 0");
 
 evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == null");
 
 evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')");
-shouldBeTrue("event.xAcceleration == 0");
-shouldBeTrue("event.yAcceleration == 0");
-shouldBeTrue("event.zAcceleration == 0");
-shouldBeTrue("event.xRotationRate == 0");
-shouldBeTrue("event.yRotationRate == 0");
-shouldBeTrue("event.zRotationRate == 0");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == 0");
 
 evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)");
-shouldBeTrue("event.xAcceleration == null");
-shouldBeTrue("event.yAcceleration == null");
-shouldBeTrue("event.zAcceleration == null");
-shouldBeTrue("event.xRotationRate == null");
-shouldBeTrue("event.yRotationRate == null");
-shouldBeTrue("event.zRotationRate == null");
+shouldBeTrue("event.acceleration == null");
+shouldBeTrue("event.accelerationIncludingGravity == null");
+shouldBeTrue("event.rotationRate == null");
 shouldBeTrue("event.interval == null");
 
 window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
index 0d3615e..2a7c624 100644
--- a/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
+++ b/LayoutTests/fast/dom/script-tests/prototype-inheritance.js
@@ -23,6 +23,7 @@ var skippedProperties = [
     "showModalDialog",
     "createBlobURL", "revokeBlobURL",
     "DeviceOrientationEvent",
+    "DeviceMotionEvent",
     "TEMPORARY", "PERSISTENT",
     "Flags",
     // Ignore this property because it only appears in debug builds.
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cc14821..a96209f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,65 @@
+2010-09-23  Hans Wennborg  <hans at chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        Update DeviceMotionEvent to spec
+        https://bugs.webkit.org/show_bug.cgi?id=46344
+
+        The spec has changed: the DeviceMotionEvent attributes accelerationX,
+        accelerationY, etc. have been baked into an 'acceleration' attribute
+        which returns an object with x, y, and z values. Likewise for the
+        rotation rate. The 'accelerationIncludingGravity' attribute is new.
+
+        * WebCore.exp.in:
+        The DeviceMotionData::create member function has changed. Also export
+        create functions for DeviceMotionData::Acceleration and RotationRate.
+
+        * bindings/js/JSDeviceMotionEventCustom.cpp:
+        (WebCore::JSDeviceMotionEvent::acceleration):
+        (WebCore::JSDeviceMotionEvent::accelerationIncludingGravity):
+        (WebCore::JSDeviceMotionEvent::rotationRate):
+        (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+        Manually create and return objects with the right attributes for
+        acceleration, accelerationIncludingGravity, and rotationRate.
+        When creating the DeviceMotionData object in initDeviceMotionEvent,
+        accept any input objects that have the right attributes.
+
+        * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
+        (WebCore::V8DeviceMotionEvent::accelerationAccessorGetter):
+        (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter):
+        (WebCore::V8DeviceMotionEvent::rotationRateAccessorGetter):
+        (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
+        V8 counterpart to the JSC code above.
+
+        * dom/DeviceMotionData.cpp:
+        (WebCore::DeviceMotionData::Acceleration::create):
+        (WebCore::DeviceMotionData::Acceleration::Acceleration):
+        (WebCore::DeviceMotionData::RotationRate::create):
+        (WebCore::DeviceMotionData::RotationRate::RotationRate):
+        (WebCore::DeviceMotionData::create):
+        (WebCore::DeviceMotionData::DeviceMotionData):
+        * dom/DeviceMotionData.h:
+        (WebCore::DeviceMotionData::Acceleration::canProvideX):
+        (WebCore::DeviceMotionData::Acceleration::canProvideY):
+        (WebCore::DeviceMotionData::Acceleration::canProvideZ):
+        (WebCore::DeviceMotionData::Acceleration::x):
+        (WebCore::DeviceMotionData::Acceleration::y):
+        (WebCore::DeviceMotionData::Acceleration::z):
+        (WebCore::DeviceMotionData::RotationRate::canProvideAlpha):
+        (WebCore::DeviceMotionData::RotationRate::canProvideBeta):
+        (WebCore::DeviceMotionData::RotationRate::canProvideGamma):
+        (WebCore::DeviceMotionData::RotationRate::alpha):
+        (WebCore::DeviceMotionData::RotationRate::beta):
+        (WebCore::DeviceMotionData::RotationRate::gamma):
+        (WebCore::DeviceMotionData::acceleration):
+        (WebCore::DeviceMotionData::accelerationIncludingGravity):
+        (WebCore::DeviceMotionData::rotationRate):
+        Add member classes Acceleration and RotationRate to DeviceMotionData.
+
+        * dom/DeviceMotionEvent.idl:
+        Update according to the spec. Acceleration and RotationRate need not
+        be backed by native classes.
+
 2010-09-23  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index e316fc2..26e3b68 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -360,7 +360,9 @@ __ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
 __ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
 __ZN7WebCore15visitedLinkHashEPKtj
 __ZN7WebCore16AbstractDatabase14setIsAvailableEb
-__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
+__ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
+__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
+__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
 __ZN7WebCore16FontFallbackList15releaseFontDataEv
 __ZN7WebCore16FontPlatformDataC1EP6NSFontbb
 __ZN7WebCore16FontPlatformDataD1Ev
diff --git a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
index 225a626..07a3019 100644
--- a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
@@ -35,54 +35,124 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSDeviceMotionEvent::xAcceleration(ExecState* exec) const
+static PassRefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(JSValue value, ExecState* exec)
 {
-    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideXAcceleration())
-        return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->xAcceleration());
+    if (value.isUndefinedOrNull())
+        return 0;
+
+    // Given the above test, this will always yield an object.
+    JSObject* object = value.toObject(exec);
+
+    JSValue xValue = object->get(exec, Identifier(exec, "x"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideX = !xValue.isUndefined();
+    double x = xValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    JSValue yValue = object->get(exec, Identifier(exec, "y"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideY = !yValue.isUndefined();
+    double y = yValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    JSValue zValue = object->get(exec, Identifier(exec, "z"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideZ = !zValue.isUndefined();
+    double z = zValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    if (!canProvideX && !canProvideY && !canProvideZ)
+        return 0;
+
+    return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
 }
 
-JSValue JSDeviceMotionEvent::yAcceleration(ExecState* exec) const
+static PassRefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSValue value, ExecState* exec)
 {
-    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideYAcceleration())
-        return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->yAcceleration());
+    if (value.isUndefinedOrNull())
+        return 0;
+
+    // Given the above test, this will always yield an object.
+    JSObject* object = value.toObject(exec);
+
+    JSValue alphaValue = object->get(exec, Identifier(exec, "alpha"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideAlpha = !alphaValue.isUndefined();
+    double alpha = alphaValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    JSValue betaValue = object->get(exec, Identifier(exec, "beta"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideBeta = !betaValue.isUndefined();
+    double beta = betaValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    JSValue gammaValue = object->get(exec, Identifier(exec, "gamma"));
+    if (exec->hadException())
+        return 0;
+    bool canProvideGamma = !gammaValue.isUndefined();
+    double gamma = gammaValue.toNumber(exec);
+    if (exec->hadException())
+        return 0;
+
+    if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
+        return 0;
+
+    return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
 }
 
-JSValue JSDeviceMotionEvent::zAcceleration(ExecState* exec) const
+static JSObject* createAccelerationObject(const DeviceMotionData::Acceleration* acceleration, ExecState* exec)
 {
-    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideZAcceleration())
-        return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->zAcceleration());
+    JSObject* object = constructEmptyObject(exec);
+    object->putDirect(Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(exec, acceleration->x()) : jsNull());
+    object->putDirect(Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(exec, acceleration->y()) : jsNull());
+    object->putDirect(Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(exec, acceleration->z()) : jsNull());
+    return object;
 }
 
-JSValue JSDeviceMotionEvent::xRotationRate(ExecState* exec) const
+static JSObject* createRotationRateObject(const DeviceMotionData::RotationRate* rotationRate, ExecState* exec)
+{
+    JSObject* object = constructEmptyObject(exec);
+    object->putDirect(Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(exec, rotationRate->alpha()) : jsNull());
+    object->putDirect(Identifier(exec, "beta"),  rotationRate->canProvideBeta()  ? jsNumber(exec, rotationRate->beta())  : jsNull());
+    object->putDirect(Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(exec, rotationRate->gamma()) : jsNull());
+    return object;
+}
+
+JSValue JSDeviceMotionEvent::acceleration(ExecState* exec) const
 {
     DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideXRotationRate())
+    if (!imp->deviceMotionData()->acceleration())
         return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->xRotationRate());
+    return createAccelerationObject(imp->deviceMotionData()->acceleration(), exec);
 }
 
-JSValue JSDeviceMotionEvent::yRotationRate(ExecState* exec) const
+JSValue JSDeviceMotionEvent::accelerationIncludingGravity(ExecState* exec) const
 {
     DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideYRotationRate())
+    if (!imp->deviceMotionData()->accelerationIncludingGravity())
         return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->yRotationRate());
+    return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity(), exec);
 }
 
-JSValue JSDeviceMotionEvent::zRotationRate(ExecState* exec) const
+JSValue JSDeviceMotionEvent::rotationRate(ExecState* exec) const
 {
     DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
-    if (!imp->deviceMotionData()->canProvideZRotationRate())
+    if (!imp->deviceMotionData()->rotationRate())
         return jsNull();
-    return jsNumber(exec, imp->deviceMotionData()->zRotationRate());
+    return createRotationRateObject(imp->deviceMotionData()->rotationRate(), exec);
 }
-    
+
 JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
 {
     DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
@@ -90,34 +160,32 @@ JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
         return jsNull();
     return jsNumber(exec, imp->deviceMotionData()->interval());
 }
-    
+
 JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
 {
     const String& type = ustringToString(exec->argument(0).toString(exec));
     bool bubbles = exec->argument(1).toBoolean(exec);
     bool cancelable = exec->argument(2).toBoolean(exec);
+    //
     // If any of the parameters are null or undefined, mark them as not provided.
     // Otherwise, use the standard JavaScript conversion.
-    bool xAccelerationProvided = !exec->argument(3).isUndefinedOrNull();
-    double xAcceleration = exec->argument(3).toNumber(exec);
-    bool yAccelerationProvided = !exec->argument(4).isUndefinedOrNull();
-    double yAcceleration = exec->argument(4).toNumber(exec);
-    bool zAccelerationProvided = !exec->argument(5).isUndefinedOrNull();
-    double zAcceleration = exec->argument(5).toNumber(exec);
-    bool xRotationRateProvided = !exec->argument(6).isUndefinedOrNull();
-    double xRotationRate = exec->argument(6).toNumber(exec);
-    bool yRotationRateProvided = !exec->argument(7).isUndefinedOrNull();
-    double yRotationRate = exec->argument(7).toNumber(exec);
-    bool zRotationRateProvided = !exec->argument(8).isUndefinedOrNull();
-    double zRotationRate = exec->argument(8).toNumber(exec);
-    bool intervalProvided = !exec->argument(9).isUndefinedOrNull();
-    double interval = exec->argument(9).toNumber(exec);
-    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration,
-                                                                         yAccelerationProvided, yAcceleration,
-                                                                         zAccelerationProvided, zAcceleration,
-                                                                         xRotationRateProvided, xRotationRate,
-                                                                         yRotationRateProvided, yRotationRate,
-                                                                         zRotationRateProvided, zRotationRate,
+    RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(exec->argument(3), exec);
+    if (exec->hadException())
+        return jsUndefined();
+
+    RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(exec->argument(4), exec);
+    if (exec->hadException())
+        return jsUndefined();
+
+    RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(exec->argument(5), exec);
+    if (exec->hadException())
+        return jsUndefined();
+
+    bool intervalProvided = !exec->argument(6).isUndefinedOrNull();
+    double interval = exec->argument(6).toNumber(exec);
+    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration,
+                                                                         accelerationIncludingGravity,
+                                                                         rotationRate,
                                                                          intervalProvided, interval);
     DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
     imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
diff --git a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
index 67f27c5..69fd35b 100644
--- a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
@@ -37,67 +37,110 @@
 
 namespace WebCore {
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::xAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+namespace {
+
+v8::Handle<v8::Value> createAccelerationObject(RefPtr<DeviceMotionData::Acceleration> acceleration)
 {
-    INC_STATS("DOM.DeviceMotionEvent.xAcceleration._get");
-    v8::Handle<v8::Object> holder = info.Holder();
-    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideXAcceleration())
-        return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->xAcceleration());
+    v8::Local<v8::Object> object = v8::Object::New();
+    object->Set(v8::String::New("x"), acceleration->canProvideX() ? v8::Number::New(acceleration->x()) : v8::Null());
+    object->Set(v8::String::New("y"), acceleration->canProvideY() ? v8::Number::New(acceleration->y()) : v8::Null());
+    object->Set(v8::String::New("z"), acceleration->canProvideZ() ? v8::Number::New(acceleration->z()) : v8::Null());
+    return object;
 }
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::yAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> createRotationRateObject(RefPtr<DeviceMotionData::RotationRate> rotationRate)
 {
-    INC_STATS("DOM.DeviceMotionEvent.yAcceleration._get");
-    v8::Handle<v8::Object> holder = info.Holder();
-    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideYAcceleration())
-        return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->yAcceleration());
+    v8::Local<v8::Object> object = v8::Object::New();
+    object->Set(v8::String::New("alpha"), rotationRate->canProvideAlpha() ? v8::Number::New(rotationRate->alpha()) : v8::Null());
+    object->Set(v8::String::New("beta"),  rotationRate->canProvideBeta()  ? v8::Number::New(rotationRate->beta())  : v8::Null());
+    object->Set(v8::String::New("gamma"), rotationRate->canProvideGamma() ? v8::Number::New(rotationRate->gamma()) : v8::Null());
+    return object;
 }
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::zAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+RefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(v8::Local<v8::Value> value)
 {
-    INC_STATS("DOM.DeviceMotionEvent.zAcceleration._get");
-    v8::Handle<v8::Object> holder = info.Holder();
-    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideZAcceleration())
-        return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->zAcceleration());
+    if (isUndefinedOrNull(value))
+        return 0;
+
+    // Given the test above, this will always yield an object.
+    v8::Local<v8::Object> object = value->ToObject();
+
+    v8::Local<v8::Value> xValue = object->Get(v8::String::New("x"));
+    bool canProvideX = !isUndefinedOrNull(xValue);
+    double x = static_cast<double>(xValue->NumberValue());
+
+    v8::Local<v8::Value> yValue = object->Get(v8::String::New("y"));
+    bool canProvideY = !isUndefinedOrNull(yValue);
+    double y = static_cast<double>(yValue->NumberValue());
+
+    v8::Local<v8::Value> zValue = object->Get(v8::String::New("z"));
+    bool canProvideZ = !isUndefinedOrNull(zValue);
+    double z = static_cast<double>(zValue->NumberValue());
+
+    if (!canProvideX && !canProvideY && !canProvideZ)
+        return 0;
+
+    return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
 }
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::xRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+RefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(v8::Local<v8::Value> value)
 {
-    INC_STATS("DOM.DeviceMotionEvent.xRotationRate._get");
+    if (isUndefinedOrNull(value))
+        return 0;
+
+    // Given the test above, this will always yield an object.
+    v8::Local<v8::Object> object = value->ToObject();
+
+    v8::Local<v8::Value> alphaValue = object->Get(v8::String::New("alpha"));
+    bool canProvideAlpha = !isUndefinedOrNull(alphaValue);
+    double alpha = static_cast<double>(alphaValue->NumberValue());
+
+    v8::Local<v8::Value> betaValue = object->Get(v8::String::New("beta"));
+    bool canProvideBeta = !isUndefinedOrNull(betaValue);
+    double beta = static_cast<double>(betaValue->NumberValue());
+
+    v8::Local<v8::Value> gammaValue = object->Get(v8::String::New("gamma"));
+    bool canProvideGamma = !isUndefinedOrNull(gammaValue);
+    double gamma = static_cast<double>(gammaValue->NumberValue());
+
+    if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
+        return 0;
+
+    return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
+}
+
+} // namespace
+
+v8::Handle<v8::Value> V8DeviceMotionEvent::accelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.DeviceMotionEvent.acceleration._get");
     v8::Handle<v8::Object> holder = info.Holder();
     DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideXRotationRate())
+    if (!imp->deviceMotionData()->acceleration())
         return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->xRotationRate());
+    return createAccelerationObject(imp->deviceMotionData()->acceleration());
 }
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::yRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> V8DeviceMotionEvent::accelerationIncludingGravityAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    INC_STATS("DOM.DeviceMotionEvent.yRotationRate._get");
+    INC_STATS("DOM.DeviceMotionEvent.accelerationIncludingGravity._get");
     v8::Handle<v8::Object> holder = info.Holder();
     DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideYRotationRate())
+    if (!imp->deviceMotionData()->accelerationIncludingGravity())
         return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->yRotationRate());
+    return createAccelerationObject(imp->deviceMotionData()->accelerationIncludingGravity());
 }
 
-v8::Handle<v8::Value> V8DeviceMotionEvent::zRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Handle<v8::Value> V8DeviceMotionEvent::rotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    INC_STATS("DOM.DeviceMotionEvent.zRotationRate._get");
+    INC_STATS("DOM.DeviceMotionEvent.rotationRate._get");
     v8::Handle<v8::Object> holder = info.Holder();
     DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
-    if (!imp->deviceMotionData()->canProvideZRotationRate())
+    if (!imp->deviceMotionData()->rotationRate())
         return v8::Null();
-    return v8::Number::New(imp->deviceMotionData()->zRotationRate());
+    return createRotationRateObject(imp->deviceMotionData()->rotationRate());
 }
 
-
 v8::Handle<v8::Value> V8DeviceMotionEvent::intervalAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     INC_STATS("DOM.DeviceMotionEvent.interval._get");
@@ -114,23 +157,15 @@ v8::Handle<v8::Value> V8DeviceMotionEvent::initDeviceMotionEventCallback(const v
     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]);
     bool bubbles = args[1]->BooleanValue();
     bool cancelable = args[2]->BooleanValue();
-    // If any of the parameters are null or undefined, mark them as not provided.
-    // Otherwise, use the standard JavaScript conversion.
-    bool xAccelerationProvided = !isUndefinedOrNull(args[3]);
-    double xAcceleration = static_cast<double>(args[3]->NumberValue());
-    bool yAccelerationProvided = !isUndefinedOrNull(args[4]);
-    double yAcceleration = static_cast<double>(args[4]->NumberValue());
-    bool zAccelerationProvided = !isUndefinedOrNull(args[5]);
-    double zAcceleration = static_cast<double>(args[5]->NumberValue());
-    bool xRotationRateProvided = !isUndefinedOrNull(args[6]);
-    double xRotationRate = static_cast<double>(args[6]->NumberValue());
-    bool yRotationRateProvided = !isUndefinedOrNull(args[7]);
-    double yRotationRate = static_cast<double>(args[7]->NumberValue());
-    bool zRotationRateProvided = !isUndefinedOrNull(args[8]);
-    double zRotationRate = static_cast<double>(args[8]->NumberValue());
-    bool intervalProvided = !isUndefinedOrNull(args[9]);
-    double interval = static_cast<double>(args[9]->NumberValue());
-    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration, yAccelerationProvided, yAcceleration, zAccelerationProvided, zAcceleration, xRotationRateProvided, xRotationRate, yRotationRateProvided, yRotationRate, zRotationRateProvided, zRotationRate, intervalProvided, interval);
+    RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(args[3]);
+    RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(args[4]);
+    RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(args[5]);
+    bool intervalProvided = !isUndefinedOrNull(args[6]);
+    double interval = static_cast<double>(args[6]->NumberValue());
+    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration,
+                                                                         accelerationIncludingGravity,
+                                                                         rotationRate,
+                                                                         intervalProvided, interval);
     imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
     return v8::Handle<v8::Value>();
 }
diff --git a/WebCore/dom/DeviceMotionData.cpp b/WebCore/dom/DeviceMotionData.cpp
index cf4b466..2ad2448 100644
--- a/WebCore/dom/DeviceMotionData.cpp
+++ b/WebCore/dom/DeviceMotionData.cpp
@@ -28,59 +28,71 @@
 
 namespace WebCore {
 
+PassRefPtr<DeviceMotionData::Acceleration> DeviceMotionData::Acceleration::create(bool canProvideX, double x,
+                                                                                  bool canProvideY, double y,
+                                                                                  bool canProvideZ, double z)
+{
+    return adoptRef(new DeviceMotionData::Acceleration(canProvideX, x, canProvideY, y, canProvideZ, z));
+}
+
+DeviceMotionData::Acceleration::Acceleration(bool canProvideX, double x,
+                                             bool canProvideY, double y,
+                                             bool canProvideZ, double z)
+    : m_x(x)
+    , m_y(y)
+    , m_z(z)
+    , m_canProvideX(canProvideX)
+    , m_canProvideY(canProvideY)
+    , m_canProvideZ(canProvideZ)
+
+{
+}
+
+PassRefPtr<DeviceMotionData::RotationRate> DeviceMotionData::RotationRate::create(bool canProvideAlpha, double alpha,
+                                                                                  bool canProvideBeta, double beta,
+                                                                                  bool canProvideGamma, double gamma)
+{
+    return adoptRef(new DeviceMotionData::RotationRate(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma));
+}
+
+DeviceMotionData::RotationRate::RotationRate(bool canProvideAlpha, double alpha,
+                                             bool canProvideBeta, double beta,
+                                             bool canProvideGamma, double gamma)
+    : m_alpha(alpha)
+    , m_beta(beta)
+    , m_gamma(gamma)
+    , m_canProvideAlpha(canProvideAlpha)
+    , m_canProvideBeta(canProvideBeta)
+    , m_canProvideGamma(canProvideGamma)
+{
+}
+
 PassRefPtr<DeviceMotionData> DeviceMotionData::create()
 {
     return adoptRef(new DeviceMotionData);
 }
 
-PassRefPtr<DeviceMotionData> DeviceMotionData::create(bool canProvideXAcceleration, double xAcceleration,
-                                                      bool canProvideYAcceleration, double yAcceleration,
-                                                      bool canProvideZAcceleration, double zAcceleration,
-                                                      bool canProvideXRotationRate, double xRotationRate,
-                                                      bool canProvideYRotationRate, double yRotationRate,
-                                                      bool canProvideZRotationRate, double zRotationRate,
+PassRefPtr<DeviceMotionData> DeviceMotionData::create(PassRefPtr<Acceleration> acceleration,
+                                                      PassRefPtr<Acceleration> accelerationIncludingGravity,
+                                                      PassRefPtr<RotationRate> rotationRate,
                                                       bool canProvideInterval, double interval)
 {
-    return adoptRef(new DeviceMotionData(canProvideXAcceleration, xAcceleration,
-                                         canProvideYAcceleration, yAcceleration,
-                                         canProvideZAcceleration, zAcceleration,
-                                         canProvideXRotationRate, xRotationRate,
-                                         canProvideYRotationRate, yRotationRate,
-                                         canProvideZRotationRate, zRotationRate,
-                                         canProvideInterval, interval));
+    return adoptRef(new DeviceMotionData(acceleration, accelerationIncludingGravity, rotationRate, canProvideInterval, interval));
 }
 
 DeviceMotionData::DeviceMotionData()
-    : m_canProvideXAcceleration(false)
-    , m_canProvideYAcceleration(false)
-    , m_canProvideZAcceleration(false)
-    , m_canProvideXRotationRate(false)
-    , m_canProvideYRotationRate(false)
-    , m_canProvideZRotationRate(false)
-    , m_canProvideInterval(false)
+    : m_canProvideInterval(false)
 {
 }
 
-DeviceMotionData::DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
-                                   bool canProvideYAcceleration, double yAcceleration,
-                                   bool canProvideZAcceleration, double zAcceleration,
-                                   bool canProvideXRotationRate, double xRotationRate,
-                                   bool canProvideYRotationRate, double yRotationRate,
-                                   bool canProvideZRotationRate, double zRotationRate,
+DeviceMotionData::DeviceMotionData(PassRefPtr<Acceleration> acceleration,
+                                   PassRefPtr<Acceleration> accelerationIncludingGravity,
+                                   PassRefPtr<RotationRate> rotationRate,
                                    bool canProvideInterval, double interval)
-    : m_canProvideXAcceleration(canProvideXAcceleration)
-    , m_canProvideYAcceleration(canProvideYAcceleration)
-    , m_canProvideZAcceleration(canProvideZAcceleration)
-    , m_canProvideXRotationRate(canProvideXRotationRate)
-    , m_canProvideYRotationRate(canProvideYRotationRate)
-    , m_canProvideZRotationRate(canProvideZRotationRate)
+    : m_acceleration(acceleration)
+    , m_accelerationIncludingGravity(accelerationIncludingGravity)
+    , m_rotationRate(rotationRate)
     , m_canProvideInterval(canProvideInterval)
-    , m_xAcceleration(xAcceleration)
-    , m_yAcceleration(yAcceleration)
-    , m_zAcceleration(zAcceleration)
-    , m_xRotationRate(xRotationRate)
-    , m_yRotationRate(yRotationRate)
-    , m_zRotationRate(zRotationRate)
     , m_interval(interval)
 {
 }
diff --git a/WebCore/dom/DeviceMotionData.h b/WebCore/dom/DeviceMotionData.h
index cd90246..4140c88 100644
--- a/WebCore/dom/DeviceMotionData.h
+++ b/WebCore/dom/DeviceMotionData.h
@@ -28,60 +28,91 @@
 
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
 class DeviceMotionData : public RefCounted<DeviceMotionData> {
 public:
+    class Acceleration : public RefCounted<DeviceMotionData::Acceleration> {
+    public:
+        static PassRefPtr<Acceleration> create(bool canProvideX, double x,
+                                               bool canProvideY, double y,
+                                               bool canProvideZ, double z);
+
+        bool canProvideX() const { return m_canProvideX; }
+        bool canProvideY() const { return m_canProvideY; }
+        bool canProvideZ() const { return m_canProvideZ; }
+
+        double x() const { return m_x; }
+        double y() const { return m_y; }
+        double z() const { return m_z; }
+
+    private:
+        Acceleration(bool canProvideX, double x,
+                     bool canProvideY, double y,
+                     bool canProvideZ, double z);
+
+        double m_x;
+        double m_y;
+        double m_z;
+
+        bool m_canProvideX;
+        bool m_canProvideY;
+        bool m_canProvideZ;
+    };
+
+    class RotationRate : public RefCounted<DeviceMotionData::RotationRate> {
+    public:
+        static PassRefPtr<RotationRate> create(bool canProvideAlpha, double alpha,
+                                               bool canProvideBeta,  double beta,
+                                               bool canProvideGamma, double gamma);
+
+        bool canProvideAlpha() const { return m_canProvideAlpha; }
+        bool canProvideBeta() const { return m_canProvideBeta; }
+        bool canProvideGamma() const { return m_canProvideGamma; }
+
+        double alpha() const { return m_alpha; }
+        double beta() const { return m_beta; }
+        double gamma() const { return m_gamma; }
+
+    private:
+        RotationRate(bool canProvideAlpha, double alpha,
+                     bool canProvideBeta,  double beta,
+                     bool canProvideGamma, double gamma);
+
+        double m_alpha;
+        double m_beta;
+        double m_gamma;
+
+        bool m_canProvideAlpha;
+        bool m_canProvideBeta;
+        bool m_canProvideGamma;
+    };
+
     static PassRefPtr<DeviceMotionData> create();
-    static PassRefPtr<DeviceMotionData> create(bool canProvideXAcceleration, double xAcceleration,
-                                               bool canProvideYAcceleration, double yAcceleration,
-                                               bool canProvideZAcceleration, double zAcceleration,
-                                               bool canProvideXRotationRate, double xRotationRate,
-                                               bool canProvideYRotationRate, double yRotationRate,
-                                               bool canProvideZRotationRate, double zRotationRate,
+    static PassRefPtr<DeviceMotionData> create(PassRefPtr<Acceleration> acceleration,
+                                               PassRefPtr<Acceleration> accelerationIncludingGravity,
+                                               PassRefPtr<RotationRate> rotationRate,
                                                bool canProvideInterval, double interval);
 
-    double xAcceleration() const { return m_xAcceleration; }
-    double yAcceleration() const { return m_yAcceleration; }
-    double zAcceleration() const { return m_zAcceleration; }
-    double xRotationRate() const { return m_xRotationRate; }
-    double yRotationRate() const { return m_yRotationRate; }
-    double zRotationRate() const { return m_zRotationRate; }
+    const Acceleration* acceleration() const { return m_acceleration.get(); }
+    const Acceleration* accelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); }
+    const RotationRate* rotationRate() const { return m_rotationRate.get(); }
     double interval() const { return m_interval; }
-
-    bool canProvideXAcceleration() const { return m_canProvideXAcceleration; }
-    bool canProvideYAcceleration() const { return m_canProvideYAcceleration; }
-    bool canProvideZAcceleration() const { return m_canProvideZAcceleration; }
-    bool canProvideXRotationRate() const { return m_canProvideXRotationRate; }
-    bool canProvideYRotationRate() const { return m_canProvideYRotationRate; }
-    bool canProvideZRotationRate() const { return m_canProvideZRotationRate; }
     bool canProvideInterval() const { return m_canProvideInterval; }
 
 private:
     DeviceMotionData();
-    DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
-                     bool canProvideYAcceleration, double yAcceleration,
-                     bool canProvideZAcceleration, double zAcceleration,
-                     bool canProvideXRotationRate, double xRotationRate,
-                     bool canProvideYRotationRate, double yRotationRate,
-                     bool canProvideZRotationRate, double zRotationRate,
+    DeviceMotionData(PassRefPtr<Acceleration> acceleration,
+                     PassRefPtr<Acceleration> accelerationIncludingGravity,
+                     PassRefPtr<RotationRate> rotationRate,
                      bool canProvideInterval, double interval);
 
-    bool m_canProvideXAcceleration;
-    bool m_canProvideYAcceleration;
-    bool m_canProvideZAcceleration;
-    bool m_canProvideXRotationRate;
-    bool m_canProvideYRotationRate;
-    bool m_canProvideZRotationRate;
+    RefPtr<Acceleration> m_acceleration;
+    RefPtr<Acceleration> m_accelerationIncludingGravity;
+    RefPtr<RotationRate> m_rotationRate;
     bool m_canProvideInterval;
-
-    double m_xAcceleration;
-    double m_yAcceleration;
-    double m_zAcceleration;
-    double m_xRotationRate;
-    double m_yRotationRate;
-    double m_zRotationRate;
     double m_interval;
 };
 
diff --git a/WebCore/dom/DeviceMotionEvent.idl b/WebCore/dom/DeviceMotionEvent.idl
index 97e8e71..437ba4c 100644
--- a/WebCore/dom/DeviceMotionEvent.idl
+++ b/WebCore/dom/DeviceMotionEvent.idl
@@ -28,14 +28,11 @@ module core {
     interface [
         Conditional=DEVICE_ORIENTATION
     ] DeviceMotionEvent : Event {
-        readonly attribute [Custom] double xAcceleration;
-        readonly attribute [Custom] double yAcceleration;
-        readonly attribute [Custom] double zAcceleration;
-        readonly attribute [Custom] double xRotationRate;
-        readonly attribute [Custom] double yRotationRate;
-        readonly attribute [Custom] double zRotationRate;
+        readonly attribute [Custom] Acceleration acceleration;
+        readonly attribute [Custom] Acceleration accelerationIncludingGravity;
+        readonly attribute [Custom] RotationRate rotationRate;
         readonly attribute [Custom] double interval;
-        [Custom] void initDeviceMotionEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in double xAcceleration, in double yAcceleration, in double zAcceleration, in double xRotationRate, in double yRotationRate, in double zRotationRate, in double interval);
+        [Custom] void initDeviceMotionEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in Acceleration acceleration, in Acceleration accelerationIncludingGravity, in RotationRate rotationRate, in double interval);
     };
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list