| Differences between
and this patch
- a/LayoutTests/ChangeLog +39 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2010-08-04  Dean Jackson  <dino@apple.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=42865
6
        Implement AccelerometerEvent
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
        Note that at this time the specified event is
13
        called Accelerometer, but this will change to DeviceMotion
14
        with the inclusion of gyroscopic results.
15
16
        * fast/dom/Window/window-properties-device-orientation-expected.txt:
17
        * fast/dom/Window/window-properties-device-orientation.html:
18
        * fast/dom/Window/window-properties.html:
19
20
        Add some tests for the DeviceMotionEvent interface.
21
22
        * fast/dom/DeviceMotion/create-event-expected.txt: Added.
23
        * fast/dom/DeviceMotion/create-event.html: Added.
24
        * fast/dom/DeviceMotion/optional-event-properties-expected.txt: Added.
25
        * fast/dom/DeviceMotion/optional-event-properties.html: Added.
26
        * fast/dom/DeviceMotion/script-tests/TEMPLATE.html: Added.
27
        * fast/dom/DeviceMotion/script-tests/create-event.js: Added.
28
        * fast/dom/DeviceMotion/script-tests/optional-event-properties.js: Added.
29
        * fast/dom/DeviceMotion/script-tests/window-property.js: Added.
30
        * fast/dom/DeviceMotion/window-property-expected.txt: Added.
31
        * fast/dom/DeviceMotion/window-property.html: Added.
32
33
        Make sure these are skipped on Mac, Win, GTK and QT.
34
35
        * platform/gtk/Skipped:
36
        * platform/mac/Skipped:
37
        * platform/qt/Skipped:
38
        * platform/win/Skipped:
39
1
2010-08-04  Kent Tamura  <tkent@chromium.org>
40
2010-08-04  Kent Tamura  <tkent@chromium.org>
2
41
3
        Unreviewed, test expectation update.
42
        Unreviewed, test expectation update.
- a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt +30 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/create-event-expected.txt_sec1
1
Tests that document.createEvent() works with DeviceMotinEvent.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS typeof event == 'object' is true
7
PASS 'type' in event is true
8
PASS 'bubbles' in event is true
9
PASS 'cancelable' in event is true
10
PASS 'xAcceleration' in event is true
11
PASS 'yAcceleration' in event is true
12
PASS 'zAcceleration' in event is true
13
PASS 'xRotationRate' in event is true
14
PASS 'yRotationRate' in event is true
15
PASS 'zRotationRate' in event is true
16
PASS 'interval' in event is true
17
PASS typeof event.type == 'string' is true
18
PASS typeof event.bubbles == 'boolean' is true
19
PASS typeof event.cancelable == 'boolean' is true
20
PASS typeof event.xAcceleration == 'object' is true
21
PASS typeof event.yAcceleration == 'object' is true
22
PASS typeof event.zAcceleration == 'object' is true
23
PASS typeof event.xRotationRate == 'object' is true
24
PASS typeof event.yRotationRate == 'object' is true
25
PASS typeof event.zRotationRate == 'object' is true
26
PASS typeof event.interval == 'object' is true
27
PASS successfullyParsed is true
28
29
TEST COMPLETE
30
- a/LayoutTests/fast/dom/DeviceMotion/create-event.html +12 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/create-event.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
4
<script src="../../js/resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<p id="description"></p>
8
<div id="console"></div>
9
<script src="script-tests/create-event.js"></script>
10
<script src="../../js/resources/js-test-post.js"></script>
11
</body>
12
</html>
- a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt +65 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt_sec1
1
Tests the optional properties of DeviceMotionEvent. Each property should be null if not set, or set to null or undefined.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
event = document.createEvent('DeviceMotionEvent')
7
PASS event.xAcceleration == null is true
8
PASS event.yAcceleration == null is true
9
PASS event.zAcceleration == null is true
10
PASS event.xRotationRate == null is true
11
PASS event.yRotationRate == null is true
12
PASS event.zRotationRate == null is true
13
PASS event.interval == null is true
14
event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)
15
PASS event.xAcceleration == 0 is true
16
PASS event.yAcceleration == 1 is true
17
PASS event.zAcceleration == 2 is true
18
PASS event.xRotationRate == 3 is true
19
PASS event.yRotationRate == 4 is true
20
PASS event.zRotationRate == 5 is true
21
PASS event.interval == 6 is true
22
event.initDeviceMotionEvent()
23
PASS event.xAcceleration == null is true
24
PASS event.yAcceleration == null is true
25
PASS event.zAcceleration == null is true
26
PASS event.xRotationRate == null is true
27
PASS event.yRotationRate == null is true
28
PASS event.zRotationRate == null is true
29
PASS event.interval == null is true
30
event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])
31
PASS event.xAcceleration == 0 is true
32
PASS event.yAcceleration == 0 is true
33
PASS event.zAcceleration == 0 is true
34
PASS event.xRotationRate == 0 is true
35
PASS event.yRotationRate == 0 is true
36
PASS event.zRotationRate == 0 is true
37
PASS event.interval == 0 is true
38
event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)
39
PASS event.xAcceleration == null is true
40
PASS event.yAcceleration == null is true
41
PASS event.zAcceleration == null is true
42
PASS event.xRotationRate == null is true
43
PASS event.yRotationRate == null is true
44
PASS event.zRotationRate == null is true
45
PASS event.interval == null is true
46
event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')
47
PASS event.xAcceleration == 0 is true
48
PASS event.yAcceleration == 0 is true
49
PASS event.zAcceleration == 0 is true
50
PASS event.xRotationRate == 0 is true
51
PASS event.yRotationRate == 0 is true
52
PASS event.zRotationRate == 0 is true
53
PASS event.interval == 0 is true
54
event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)
55
PASS event.xAcceleration == null is true
56
PASS event.yAcceleration == null is true
57
PASS event.zAcceleration == null is true
58
PASS event.xRotationRate == null is true
59
PASS event.yRotationRate == null is true
60
PASS event.zRotationRate == null is true
61
PASS event.interval == null is true
62
PASS successfullyParsed is true
63
64
TEST COMPLETE
65
- a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html +12 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
4
<script src="../../js/resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<p id="description"></p>
8
<div id="console"></div>
9
<script src="script-tests/optional-event-properties.js"></script>
10
<script src="../../js/resources/js-test-post.js"></script>
11
</body>
12
</html>
- a/LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html +12 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/script-tests/TEMPLATE.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
4
<script src="../../js/resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<p id="description"></p>
8
<div id="console"></div>
9
<script src="YOUR_JS_FILE_HERE"></script>
10
<script src="../../js/resources/js-test-post.js"></script>
11
</body>
12
</html>
- a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js +29 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js_sec1
1
description("Tests that document.createEvent() works with DeviceMotinEvent.");
2
3
var event = document.createEvent('DeviceMotionEvent');
4
5
shouldBeTrue("typeof event == 'object'");
6
7
shouldBeTrue("'type' in event");
8
shouldBeTrue("'bubbles' in event");
9
shouldBeTrue("'cancelable' in event");
10
shouldBeTrue("'xAcceleration' in event");
11
shouldBeTrue("'yAcceleration' in event");
12
shouldBeTrue("'zAcceleration' in event");
13
shouldBeTrue("'xRotationRate' in event");
14
shouldBeTrue("'yRotationRate' in event");
15
shouldBeTrue("'zRotationRate' in event");
16
shouldBeTrue("'interval' in event");
17
18
shouldBeTrue("typeof event.type == 'string'");
19
shouldBeTrue("typeof event.bubbles == 'boolean'");
20
shouldBeTrue("typeof event.cancelable == 'boolean'");
21
shouldBeTrue("typeof event.xAcceleration == 'object'");
22
shouldBeTrue("typeof event.yAcceleration == 'object'");
23
shouldBeTrue("typeof event.zAcceleration == 'object'");
24
shouldBeTrue("typeof event.xRotationRate == 'object'");
25
shouldBeTrue("typeof event.yRotationRate == 'object'");
26
shouldBeTrue("typeof event.zRotationRate == 'object'");
27
shouldBeTrue("typeof event.interval == 'object'");
28
29
window.successfullyParsed = true;
- a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js +68 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/script-tests/optional-event-properties.js_sec1
1
description("Tests the optional properties of DeviceMotionEvent. Each property should be null if not set, or set to null or undefined.");
2
3
var event;
4
5
evalAndLog("event = document.createEvent('DeviceMotionEvent')");
6
shouldBeTrue("event.xAcceleration == null");
7
shouldBeTrue("event.yAcceleration == null");
8
shouldBeTrue("event.zAcceleration == null");
9
shouldBeTrue("event.xRotationRate == null");
10
shouldBeTrue("event.yRotationRate == null");
11
shouldBeTrue("event.zRotationRate == null");
12
shouldBeTrue("event.interval == null");
13
14
evalAndLog("event.initDeviceMotionEvent('', false, false, 0, 1, 2, 3, 4, 5, 6)");
15
shouldBeTrue("event.xAcceleration == 0");
16
shouldBeTrue("event.yAcceleration == 1");
17
shouldBeTrue("event.zAcceleration == 2");
18
shouldBeTrue("event.xRotationRate == 3");
19
shouldBeTrue("event.yRotationRate == 4");
20
shouldBeTrue("event.zRotationRate == 5");
21
shouldBeTrue("event.interval == 6");
22
23
evalAndLog("event.initDeviceMotionEvent()");
24
shouldBeTrue("event.xAcceleration == null");
25
shouldBeTrue("event.yAcceleration == null");
26
shouldBeTrue("event.zAcceleration == null");
27
shouldBeTrue("event.xRotationRate == null");
28
shouldBeTrue("event.yRotationRate == null");
29
shouldBeTrue("event.zRotationRate == null");
30
shouldBeTrue("event.interval == null");
31
32
evalAndLog("event.initDeviceMotionEvent('', false, false, [], [], [], [], [], [], [])");
33
shouldBeTrue("event.xAcceleration == 0");
34
shouldBeTrue("event.yAcceleration == 0");
35
shouldBeTrue("event.zAcceleration == 0");
36
shouldBeTrue("event.xRotationRate == 0");
37
shouldBeTrue("event.yRotationRate == 0");
38
shouldBeTrue("event.zRotationRate == 0");
39
shouldBeTrue("event.interval == 0");
40
41
evalAndLog("event.initDeviceMotionEvent('', false, false, undefined, undefined, undefined, undefined, undefined, undefined, undefined)");
42
shouldBeTrue("event.xAcceleration == null");
43
shouldBeTrue("event.yAcceleration == null");
44
shouldBeTrue("event.zAcceleration == null");
45
shouldBeTrue("event.xRotationRate == null");
46
shouldBeTrue("event.yRotationRate == null");
47
shouldBeTrue("event.zRotationRate == null");
48
shouldBeTrue("event.interval == null");
49
50
evalAndLog("event.initDeviceMotionEvent('', false, false, '', '', '', '', '', '', '')");
51
shouldBeTrue("event.xAcceleration == 0");
52
shouldBeTrue("event.yAcceleration == 0");
53
shouldBeTrue("event.zAcceleration == 0");
54
shouldBeTrue("event.xRotationRate == 0");
55
shouldBeTrue("event.yRotationRate == 0");
56
shouldBeTrue("event.zRotationRate == 0");
57
shouldBeTrue("event.interval == 0");
58
59
evalAndLog("event.initDeviceMotionEvent('', false, false, null, null, null, null, null, null, null)");
60
shouldBeTrue("event.xAcceleration == null");
61
shouldBeTrue("event.yAcceleration == null");
62
shouldBeTrue("event.zAcceleration == null");
63
shouldBeTrue("event.xRotationRate == null");
64
shouldBeTrue("event.yRotationRate == null");
65
shouldBeTrue("event.zRotationRate == null");
66
shouldBeTrue("event.interval == null");
67
68
window.successfullyParsed = true;
- a/LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js +31 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/script-tests/window-property.js_sec1
1
description("Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present.");
2
3
function hasDeviceMotionEventProperty()
4
{
5
    for (var property in window) {
6
        if (property == "DeviceMotionEvent")
7
            return true;
8
    }
9
    return false;
10
}
11
12
shouldBeTrue("typeof window.DeviceMotionEvent == 'object'");
13
shouldBeTrue("hasDeviceMotionEventProperty()");
14
shouldBeTrue("'DeviceMotionEvent' in window");
15
shouldBeTrue("window.hasOwnProperty('DeviceMotionEvent')");
16
17
function hasOnDeviceMotionProperty()
18
{
19
    for (var property in window) {
20
        if (property == "ondevicemotion")
21
            return true;
22
    }
23
    return false;
24
}
25
26
shouldBeTrue("typeof window.ondevicemotion == 'object'");
27
shouldBeTrue("hasOnDeviceMotionProperty()");
28
shouldBeTrue("'ondevicemotion' in window");
29
shouldBeTrue("window.hasOwnProperty('ondevicemotion')");
30
31
window.successfullyParsed = true;
- a/LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt +17 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/window-property-expected.txt_sec1
1
Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS typeof window.DeviceMotionEvent == 'object' is true
7
PASS hasDeviceMotionEventProperty() is true
8
PASS 'DeviceMotionEvent' in window is true
9
PASS window.hasOwnProperty('DeviceMotionEvent') is true
10
PASS typeof window.ondevicemotion == 'object' is true
11
PASS hasOnDeviceMotionProperty() is true
12
PASS 'ondevicemotion' in window is true
13
PASS window.hasOwnProperty('ondevicemotion') is true
14
PASS successfullyParsed is true
15
16
TEST COMPLETE
17
- a/LayoutTests/fast/dom/DeviceMotion/window-property.html +12 lines
Line 0 a/LayoutTests/fast/dom/DeviceMotion/window-property.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
4
<script src="../../js/resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<p id="description"></p>
8
<div id="console"></div>
9
<script src="script-tests/window-property.js"></script>
10
<script src="../../js/resources/js-test-post.js"></script>
11
</body>
12
</html>
- a/LayoutTests/fast/dom/Window/window-properties-device-orientation-expected.txt -2 / +54 lines
Lines 1-5 a/LayoutTests/fast/dom/Window/window-properties-device-orientation-expected.txt_sec1
1
This test dumps all of the properties that are reachable from the window.DeviceOrientationEvent and window.ondeviceorientation objects, along with their types.
1
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. These properties are currently guarded by ENABLE_DEVICE_ORIENTATION.
2
2
3
window.DeviceOrientationEvent [function]
3
window.DeviceMotionEvent [object DeviceMotionEventConstructor]
4
window.DeviceMotionEvent.prototype [object DeviceMotionEventPrototype]
5
window.DeviceMotionEvent.prototype.AT_TARGET [number]
6
window.DeviceMotionEvent.prototype.BLUR [number]
7
window.DeviceMotionEvent.prototype.BUBBLING_PHASE [number]
8
window.DeviceMotionEvent.prototype.CAPTURING_PHASE [number]
9
window.DeviceMotionEvent.prototype.CHANGE [number]
10
window.DeviceMotionEvent.prototype.CLICK [number]
11
window.DeviceMotionEvent.prototype.DBLCLICK [number]
12
window.DeviceMotionEvent.prototype.DRAGDROP [number]
13
window.DeviceMotionEvent.prototype.FOCUS [number]
14
window.DeviceMotionEvent.prototype.KEYDOWN [number]
15
window.DeviceMotionEvent.prototype.KEYPRESS [number]
16
window.DeviceMotionEvent.prototype.KEYUP [number]
17
window.DeviceMotionEvent.prototype.MOUSEDOWN [number]
18
window.DeviceMotionEvent.prototype.MOUSEDRAG [number]
19
window.DeviceMotionEvent.prototype.MOUSEMOVE [number]
20
window.DeviceMotionEvent.prototype.MOUSEOUT [number]
21
window.DeviceMotionEvent.prototype.MOUSEOVER [number]
22
window.DeviceMotionEvent.prototype.MOUSEUP [number]
23
window.DeviceMotionEvent.prototype.SELECT [number]
24
window.DeviceMotionEvent.prototype.initDeviceMotionEvent [function]
25
window.DeviceMotionEvent.prototype.initEvent [function]
26
window.DeviceMotionEvent.prototype.preventDefault [function]
27
window.DeviceMotionEvent.prototype.stopImmediatePropagation [function]
28
window.DeviceMotionEvent.prototype.stopPropagation [function]
29
window.ondevicemotion [null]
30
window.DeviceOrientationEvent [object DeviceOrientationEventConstructor]
31
window.DeviceOrientationEvent.prototype [object DeviceOrientationEventPrototype]
32
window.DeviceOrientationEvent.prototype.AT_TARGET [number]
33
window.DeviceOrientationEvent.prototype.BLUR [number]
34
window.DeviceOrientationEvent.prototype.BUBBLING_PHASE [number]
35
window.DeviceOrientationEvent.prototype.CAPTURING_PHASE [number]
36
window.DeviceOrientationEvent.prototype.CHANGE [number]
37
window.DeviceOrientationEvent.prototype.CLICK [number]
38
window.DeviceOrientationEvent.prototype.DBLCLICK [number]
39
window.DeviceOrientationEvent.prototype.DRAGDROP [number]
40
window.DeviceOrientationEvent.prototype.FOCUS [number]
41
window.DeviceOrientationEvent.prototype.KEYDOWN [number]
42
window.DeviceOrientationEvent.prototype.KEYPRESS [number]
43
window.DeviceOrientationEvent.prototype.KEYUP [number]
44
window.DeviceOrientationEvent.prototype.MOUSEDOWN [number]
45
window.DeviceOrientationEvent.prototype.MOUSEDRAG [number]
46
window.DeviceOrientationEvent.prototype.MOUSEMOVE [number]
47
window.DeviceOrientationEvent.prototype.MOUSEOUT [number]
48
window.DeviceOrientationEvent.prototype.MOUSEOVER [number]
49
window.DeviceOrientationEvent.prototype.MOUSEUP [number]
50
window.DeviceOrientationEvent.prototype.SELECT [number]
51
window.DeviceOrientationEvent.prototype.initDeviceOrientationEvent [function]
52
window.DeviceOrientationEvent.prototype.initEvent [function]
53
window.DeviceOrientationEvent.prototype.preventDefault [function]
54
window.DeviceOrientationEvent.prototype.stopImmediatePropagation [function]
55
window.DeviceOrientationEvent.prototype.stopPropagation [function]
4
window.ondeviceorientation [null]
56
window.ondeviceorientation [null]
5
57
- a/LayoutTests/fast/dom/Window/window-properties-device-orientation.html -1 / +4 lines
Lines 1-4 a/LayoutTests/fast/dom/Window/window-properties-device-orientation.html_sec1
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>
2
<hr>
3
<hr>
3
<pre id="pre"></pre>
4
<pre id="pre"></pre>
4
5
Lines 88-93 function logProperties(object, objectName) a/LayoutTests/fast/dom/Window/window-properties-device-orientation.html_sec2
88
    }
89
    }
89
}
90
}
90
91
92
logValue('window.DeviceMotionEvent');
93
logValue('window.ondevicemotion');
91
logValue('window.DeviceOrientationEvent');
94
logValue('window.DeviceOrientationEvent');
92
logValue('window.ondeviceorientation');
95
logValue('window.ondeviceorientation');
93
flushLog();
96
flushLog();
- a/LayoutTests/fast/dom/Window/window-properties.html +2 lines
Lines 85-90 var __skip__ = { a/LayoutTests/fast/dom/Window/window-properties.html_sec1
85
    "window.FileReader" : 1,
85
    "window.FileReader" : 1,
86
    "window.DeviceOrientationEvent" : 1,
86
    "window.DeviceOrientationEvent" : 1,
87
    "window.ondeviceorientation" : 1,
87
    "window.ondeviceorientation" : 1,
88
    "window.DeviceMotionEvent" : 1,
89
    "window.ondevicemotion" : 1,
88
    "window.webkitPerformance" : 1,
90
    "window.webkitPerformance" : 1,
89
91
90
    // showModalDialog is not implemented on all platforms in DumpRenderTree.
92
    // showModalDialog is not implemented on all platforms in DumpRenderTree.
- a/LayoutTests/platform/gtk/Skipped +3 lines
Lines 1081-1086 fast/dom/client-width-height-quirks.html a/LayoutTests/platform/gtk/Skipped_sec1
1081
fast/dom/client-width-height.html
1081
fast/dom/client-width-height.html
1082
fast/dom/cssTarget-crash.html
1082
fast/dom/cssTarget-crash.html
1083
fast/dom/frame-loading-via-document-write.html
1083
fast/dom/frame-loading-via-document-write.html
1084
fast/dom/DeviceMotion/create-event.html
1085
fast/dom/DeviceMotion/optional-event-properties.html
1086
fast/dom/DeviceMotion/window-property.html
1084
fast/dom/DeviceOrientation/basic-operation.html
1087
fast/dom/DeviceOrientation/basic-operation.html
1085
fast/dom/DeviceOrientation/create-event.html
1088
fast/dom/DeviceOrientation/create-event.html
1086
fast/dom/DeviceOrientation/optional-event-properties.html
1089
fast/dom/DeviceOrientation/optional-event-properties.html
- a/LayoutTests/platform/mac/Skipped -1 / +2 lines
Lines 240-246 canvas/philip/tests/type.prototype.html a/LayoutTests/platform/mac/Skipped_sec1
240
# IndexedDB is not yet enabled.
240
# IndexedDB is not yet enabled.
241
storage/indexeddb
241
storage/indexeddb
242
242
243
# This port doesn't support DeviceOrientation.
243
# This port doesn't support DeviceMotion or DeviceOrientation.
244
fast/dom/DeviceMotion
244
fast/dom/DeviceOrientation
245
fast/dom/DeviceOrientation
245
fast/dom/Window/window-properties-device-orientation.html
246
fast/dom/Window/window-properties-device-orientation.html
246
247
- a/LayoutTests/platform/qt/Skipped -1 / +2 lines
Lines 78-84 plugins/clicking-missing-plugin-fires-delegate.html a/LayoutTests/platform/qt/Skipped_sec1
78
#       Feature not supported... yet
78
#       Feature not supported... yet
79
# =========================================================================== #
79
# =========================================================================== #
80
80
81
# This port doesn't support DeviceOrientation.
81
# This port doesn't support DeviceMotion or DeviceOrientation.
82
fast/dom/DeviceMotion
82
fast/dom/DeviceOrientation
83
fast/dom/DeviceOrientation
83
fast/dom/Window/window-properties-device-orientation.html
84
fast/dom/Window/window-properties-device-orientation.html
84
85
- a/LayoutTests/platform/win/Skipped -1 / +2 lines
Lines 871-877 editing/spelling/context-menu-suggestions.html a/LayoutTests/platform/win/Skipped_sec1
871
# IndexedDB is not yet enabled.
871
# IndexedDB is not yet enabled.
872
storage/indexeddb
872
storage/indexeddb
873
873
874
# This port doesn't support DeviceOrientation.
874
# This port doesn't support DeviceMotion or DeviceOrientation.
875
fast/dom/DeviceMotion
875
fast/dom/DeviceOrientation
876
fast/dom/DeviceOrientation
876
fast/dom/Window/window-properties-device-orientation.html
877
fast/dom/Window/window-properties-device-orientation.html
877
878
- a/WebCore/Android.derived.jscbindings.mk +1 lines
Lines 104-109 GEN := \ a/WebCore/Android.derived.jscbindings.mk_sec1
104
    $(intermediates)/dom/JSDOMCoreException.h \
104
    $(intermediates)/dom/JSDOMCoreException.h \
105
    $(intermediates)/dom/JSDOMImplementation.h \
105
    $(intermediates)/dom/JSDOMImplementation.h \
106
    $(intermediates)/dom/JSDOMStringList.h \
106
    $(intermediates)/dom/JSDOMStringList.h \
107
    $(intermediates)/dom/JSDeviceMotionEvent.h \
107
    $(intermediates)/dom/JSDeviceOrientationEvent.h \
108
    $(intermediates)/dom/JSDeviceOrientationEvent.h \
108
    $(intermediates)/dom/JSDocument.h \
109
    $(intermediates)/dom/JSDocument.h \
109
    $(intermediates)/dom/JSDocumentFragment.h \
110
    $(intermediates)/dom/JSDocumentFragment.h \
- a/WebCore/Android.derived.v8bindings.mk +1 lines
Lines 86-91 GEN := \ a/WebCore/Android.derived.v8bindings.mk_sec1
86
    $(intermediates)/bindings/V8DOMCoreException.h \
86
    $(intermediates)/bindings/V8DOMCoreException.h \
87
    $(intermediates)/bindings/V8DOMImplementation.h \
87
    $(intermediates)/bindings/V8DOMImplementation.h \
88
    $(intermediates)/bindings/V8DOMStringList.h \
88
    $(intermediates)/bindings/V8DOMStringList.h \
89
    $(intermediates)/bindings/V8DeviceMotionEvent.h \
89
    $(intermediates)/bindings/V8DeviceOrientationEvent.h \
90
    $(intermediates)/bindings/V8DeviceOrientationEvent.h \
90
    $(intermediates)/bindings/V8Document.h \
91
    $(intermediates)/bindings/V8Document.h \
91
    $(intermediates)/bindings/V8DocumentFragment.h \
92
    $(intermediates)/bindings/V8DocumentFragment.h \
- a/WebCore/Android.jscbindings.mk +1 lines
Lines 93-98 LOCAL_SRC_FILES += \ a/WebCore/Android.jscbindings.mk_sec1
93
	bindings/js/JSDatabaseCustom.cpp \
93
	bindings/js/JSDatabaseCustom.cpp \
94
	bindings/js/JSDedicatedWorkerContextCustom.cpp \
94
	bindings/js/JSDedicatedWorkerContextCustom.cpp \
95
	bindings/js/JSDesktopNotificationsCustom.cpp \
95
	bindings/js/JSDesktopNotificationsCustom.cpp \
96
	bindings/js/JSDeviceMotionEventCustom.cpp \
96
	bindings/js/JSDeviceOrientationEventCustom.cpp \
97
	bindings/js/JSDeviceOrientationEventCustom.cpp \
97
	bindings/js/JSDocumentCustom.cpp \
98
	bindings/js/JSDocumentCustom.cpp \
98
	bindings/js/JSElementCustom.cpp \
99
	bindings/js/JSElementCustom.cpp \
- a/WebCore/Android.mk +3 lines
Lines 117-122 LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ a/WebCore/Android.mk_sec1
117
	dom/DOMImplementation.cpp \
117
	dom/DOMImplementation.cpp \
118
	dom/DOMStringList.cpp \
118
	dom/DOMStringList.cpp \
119
	dom/DecodedDataDocumentParser.cpp \
119
	dom/DecodedDataDocumentParser.cpp \
120
	dom/DeviceMotionController.cpp \
121
	dom/DeviceMotionData.cpp \
122
	dom/DeviceMotionEvent.cpp \
120
	dom/Document.cpp \
123
	dom/Document.cpp \
121
	dom/DocumentFragment.cpp \
124
	dom/DocumentFragment.cpp \
122
	dom/DocumentParser.cpp \
125
	dom/DocumentParser.cpp \
- a/WebCore/Android.v8bindings.mk +1 lines
Lines 108-113 LOCAL_SRC_FILES += \ a/WebCore/Android.v8bindings.mk_sec1
108
	bindings/v8/custom/V8DatabaseCallback.cpp \
108
	bindings/v8/custom/V8DatabaseCallback.cpp \
109
	bindings/v8/custom/V8DatabaseCustom.cpp \
109
	bindings/v8/custom/V8DatabaseCustom.cpp \
110
	bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
110
	bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
111
	bindings/v8/custom/V8DeviceMotionEventCustom.cpp \
111
	bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
112
	bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
112
	bindings/v8/custom/V8DocumentCustom.cpp \
113
	bindings/v8/custom/V8DocumentCustom.cpp \
113
	bindings/v8/custom/V8DocumentLocationCustom.cpp \
114
	bindings/v8/custom/V8DocumentLocationCustom.cpp \
- a/WebCore/CMakeLists.txt +5 lines
Lines 144-149 SET(WebCore_IDL_FILES a/WebCore/CMakeLists.txt_sec1
144
    dom/Comment.idl
144
    dom/Comment.idl
145
    dom/CompositionEvent.idl
145
    dom/CompositionEvent.idl
146
    dom/CustomEvent.idl
146
    dom/CustomEvent.idl
147
    dom/DeviceMotionEvent.idl
147
    dom/DeviceOrientationEvent.idl
148
    dom/DeviceOrientationEvent.idl
148
    dom/DocumentFragment.idl
149
    dom/DocumentFragment.idl
149
    dom/Document.idl
150
    dom/Document.idl
Lines 594-599 SET(WebCore_SOURCES a/WebCore/CMakeLists.txt_sec2
594
    bindings/js/JSDataGridDataSource.cpp
595
    bindings/js/JSDataGridDataSource.cpp
595
    bindings/js/JSDebugWrapperSet.cpp
596
    bindings/js/JSDebugWrapperSet.cpp
596
    bindings/js/JSDedicatedWorkerContextCustom.cpp
597
    bindings/js/JSDedicatedWorkerContextCustom.cpp
598
    bindings/js/JSDeviceMotionEventCustom.cpp
597
    bindings/js/JSDeviceOrientationEventCustom.cpp
599
    bindings/js/JSDeviceOrientationEventCustom.cpp
598
    bindings/js/JSDocumentCustom.cpp
600
    bindings/js/JSDocumentCustom.cpp
599
    bindings/js/JSDOMApplicationCacheCustom.cpp
601
    bindings/js/JSDOMApplicationCacheCustom.cpp
Lines 790-795 SET(WebCore_SOURCES a/WebCore/CMakeLists.txt_sec3
790
    dom/CustomEvent.cpp
792
    dom/CustomEvent.cpp
791
    dom/DatasetDOMStringMap.cpp
793
    dom/DatasetDOMStringMap.cpp
792
    dom/DecodedDataDocumentParser.cpp
794
    dom/DecodedDataDocumentParser.cpp
795
    dom/DeviceMotionController.cpp
796
    dom/DeviceMotionData.cpp
797
    dom/DeviceMotionEvent.cpp
793
    dom/DeviceOrientation.cpp
798
    dom/DeviceOrientation.cpp
794
    dom/DeviceOrientationController.cpp
799
    dom/DeviceOrientationController.cpp
795
    dom/DeviceOrientationEvent.cpp
800
    dom/DeviceOrientationEvent.cpp
- a/WebCore/ChangeLog +75 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-08-04  Dean Jackson  <dino@apple.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=42865
6
        Implement AccelerometerEvent
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
        Note also that at this time the specified event is
15
        called Accelerometer, but this will change to DeviceMotion
16
        with the inclusion of gyroscopic results.
17
18
        Tests: fast/dom/DeviceMotion/create-event.html
19
               fast/dom/DeviceMotion/optional-event-properties.html
20
               fast/dom/DeviceMotion/window-property.html
21
22
        * Android.derived.jscbindings.mk:
23
        * Android.derived.v8bindings.mk:
24
        * Android.jscbindings.mk:
25
        * Android.mk:
26
        * Android.v8bindings.mk:
27
        * CMakeLists.txt:
28
        * Configurations/FeatureDefines.xcconfig:
29
        * DerivedSources.make:
30
        * GNUmakefile.am:
31
        * WebCore.gypi:
32
        * WebCore.pro:
33
        * WebCore.vcproj/WebCore.vcproj:
34
        * WebCore.xcodeproj/project.pbxproj:
35
          - Add new files for DeviceMotionEvent build support
36
        * bindings/generic/RuntimeEnabledFeatures.cpp:
37
        * bindings/generic/RuntimeEnabledFeatures.h:
38
          - new runtime flags for device motion
39
        * bindings/js/JSDeviceMotionEventCustom.cpp: Added.
40
        * bindings/v8/custom/V8DeviceMotionEventCustom.cpp: Added.
41
          - Custom JS binding to translate property access through
42
            to the DeviceMotionData object that the Event holds
43
        * bindings/js/JSEventCustom.cpp:
44
          - Include the custom code for DeviceMotionEvent
45
        * dom/DeviceMotionClient.h: Added.
46
          - Pure virtual client for DeviceMotion access
47
        * dom/DeviceMotionController.cpp: Added.
48
        * dom/DeviceMotionController.h: Added.
49
          - Controller class that manages event dispatch
50
        * dom/DeviceMotionData.cpp: Added.
51
        * dom/DeviceMotionData.h: Added.
52
          - Representation of the data that comes from a device motion
53
            client that is then used within the event.
54
        * dom/DeviceMotionEvent.cpp: Added.
55
        * dom/DeviceMotionEvent.h: Added.
56
        * dom/DeviceMotionEvent.idl: Added.
57
          - The actual event implementation
58
        * dom/Document.cpp:
59
        (WebCore::Document::createEvent):
60
          - Update createEvent to allow "devicemotion" events
61
        * dom/Event.cpp:
62
        * dom/Event.h:
63
          - isDeviceMotionEvent virtual method
64
        * dom/EventNames.h:
65
          - new "devicemotion" event type
66
        * page/DOMWindow.cpp:
67
        (WebCore::DOMWindow::addEventListener):
68
        * page/DOMWindow.h:
69
        * page/DOMWindow.idl:
70
          - allow creation of "devicemotion" events and pass registration
71
            through to the Page's deviceMotionController object
72
        * page/Page.cpp:
73
        * page/Page.h:
74
          - new PageClient for deviceMotionController
75
1
2010-08-04  Antonio Gomes  <tonikitoo@webkit.org>
76
2010-08-04  Antonio Gomes  <tonikitoo@webkit.org>
2
77
3
        Reviewed by Daniel Bates.
78
        Reviewed by Daniel Bates.
- a/WebCore/DerivedSources.make +1 lines
Lines 127-132 DOM_CLASSES = \ a/WebCore/DerivedSources.make_sec1
127
    Database \
127
    Database \
128
    DatabaseCallback \
128
    DatabaseCallback \
129
    DatabaseSync \
129
    DatabaseSync \
130
    DeviceMotionEvent \
130
    DeviceOrientationEvent \
131
    DeviceOrientationEvent \
131
    Document \
132
    Document \
132
    DocumentFragment \
133
    DocumentFragment \
- a/WebCore/GNUmakefile.am +10 lines
Lines 181-186 webcore_built_sources += \ a/WebCore/GNUmakefile.am_sec1
181
	DerivedSources/WebCore/JSDataGridColumnList.h \
181
	DerivedSources/WebCore/JSDataGridColumnList.h \
182
	DerivedSources/WebCore/JSDedicatedWorkerContext.cpp \
182
	DerivedSources/WebCore/JSDedicatedWorkerContext.cpp \
183
	DerivedSources/WebCore/JSDedicatedWorkerContext.h \
183
	DerivedSources/WebCore/JSDedicatedWorkerContext.h \
184
	DerivedSources/WebCore/JSDeviceMotionEvent.cpp \
185
	DerivedSources/WebCore/JSDeviceMotionEvent.h \
184
	DerivedSources/WebCore/JSDeviceOrientationEvent.cpp \
186
	DerivedSources/WebCore/JSDeviceOrientationEvent.cpp \
185
	DerivedSources/WebCore/JSDeviceOrientationEvent.h \
187
	DerivedSources/WebCore/JSDeviceOrientationEvent.h \
186
	DerivedSources/WebCore/JSDocument.cpp \
188
	DerivedSources/WebCore/JSDocument.cpp \
Lines 671-676 webcore_sources += \ a/WebCore/GNUmakefile.am_sec2
671
	WebCore/bindings/js/JSDOMWindowShell.h \
673
	WebCore/bindings/js/JSDOMWindowShell.h \
672
	WebCore/bindings/js/JSDOMWrapper.cpp \
674
	WebCore/bindings/js/JSDOMWrapper.cpp \
673
	WebCore/bindings/js/JSDOMWrapper.h \
675
	WebCore/bindings/js/JSDOMWrapper.h \
676
	WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
674
	WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
677
	WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
675
	WebCore/bindings/js/JSDocumentCustom.cpp \
678
	WebCore/bindings/js/JSDocumentCustom.cpp \
676
	WebCore/bindings/js/JSElementCustom.cpp \
679
	WebCore/bindings/js/JSElementCustom.cpp \
Lines 1021-1026 webcore_sources += \ a/WebCore/GNUmakefile.am_sec3
1021
	WebCore/dom/DatasetDOMStringMap.h \
1024
	WebCore/dom/DatasetDOMStringMap.h \
1022
	WebCore/dom/DecodedDataDocumentParser.cpp \
1025
	WebCore/dom/DecodedDataDocumentParser.cpp \
1023
	WebCore/dom/DecodedDataDocumentParser.h \
1026
	WebCore/dom/DecodedDataDocumentParser.h \
1027
	WebCore/dom/DeviceMotionClient.h \
1028
	WebCore/dom/DeviceMotionController.cpp \
1029
	WebCore/dom/DeviceMotionController.h \
1030
	WebCore/dom/DeviceMotionData.cpp \
1031
	WebCore/dom/DeviceMotionData.h \
1032
	WebCore/dom/DeviceMotionEvent.cpp \
1033
	WebCore/dom/DeviceMotionEvent.h \
1024
	WebCore/dom/DeviceOrientation.cpp \
1034
	WebCore/dom/DeviceOrientation.cpp \
1025
	WebCore/dom/DeviceOrientation.h \
1035
	WebCore/dom/DeviceOrientation.h \
1026
	WebCore/dom/DeviceOrientationClient.h \
1036
	WebCore/dom/DeviceOrientationClient.h \
- a/WebCore/WebCore.exp.in +1 lines
Lines 404-409 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE a/WebCore/WebCore.exp.in_sec1
404
__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPNS_10StringImplEPNS0_8JSStringEEES5_
404
__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPNS_10StringImplEPNS0_8JSStringEEES5_
405
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
405
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
406
__ZN7WebCore17DOMImplementation14isTextMIMETypeERKNS_6StringE
406
__ZN7WebCore17DOMImplementation14isTextMIMETypeERKNS_6StringE
407
__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
407
__ZN7WebCore17DeviceOrientation6createEbdbdbd
408
__ZN7WebCore17DeviceOrientation6createEbdbdbd
408
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
409
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
409
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
410
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
- a/WebCore/WebCore.gypi +10 lines
Lines 43-48 a/WebCore/WebCore.gypi_sec1
43
            'dom/DOMImplementation.idl',
43
            'dom/DOMImplementation.idl',
44
            'dom/DOMStringList.idl',
44
            'dom/DOMStringList.idl',
45
            'dom/DOMStringMap.idl',
45
            'dom/DOMStringMap.idl',
46
            'dom/DeviceMotionEvent.idl',
46
            'dom/DeviceOrientationEvent.idl',
47
            'dom/DeviceOrientationEvent.idl',
47
            'dom/Document.idl',
48
            'dom/Document.idl',
48
            'dom/DocumentFragment.idl',
49
            'dom/DocumentFragment.idl',
Lines 548-553 a/WebCore/WebCore.gypi_sec2
548
            'bindings/js/JSDedicatedWorkerContextCustom.cpp',
549
            'bindings/js/JSDedicatedWorkerContextCustom.cpp',
549
            'bindings/js/JSDebugWrapperSet.cpp',
550
            'bindings/js/JSDebugWrapperSet.cpp',
550
            'bindings/js/JSDebugWrapperSet.h',
551
            'bindings/js/JSDebugWrapperSet.h',
552
            'bindings/js/JSDeviceMotionEventCustom.cpp',
551
            'bindings/js/JSDeviceOrientationEventCustom.cpp',
553
            'bindings/js/JSDeviceOrientationEventCustom.cpp',
552
            'bindings/js/JSDocumentCustom.cpp',
554
            'bindings/js/JSDocumentCustom.cpp',
553
            'bindings/js/JSDOMApplicationCacheCustom.cpp',
555
            'bindings/js/JSDOMApplicationCacheCustom.cpp',
Lines 744-749 a/WebCore/WebCore.gypi_sec3
744
            'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
746
            'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
745
            'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
747
            'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
746
            'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
748
            'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
749
            'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
747
            'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
750
            'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
748
            'bindings/v8/custom/V8DocumentLocationCustom.cpp',
751
            'bindings/v8/custom/V8DocumentLocationCustom.cpp',
749
            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
752
            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
Lines 1127-1132 a/WebCore/WebCore.gypi_sec4
1127
            'dom/DatasetDOMStringMap.h',
1130
            'dom/DatasetDOMStringMap.h',
1128
            'dom/DecodedDataDocumentParser.cpp',
1131
            'dom/DecodedDataDocumentParser.cpp',
1129
            'dom/DecodedDataDocumentParser.h',
1132
            'dom/DecodedDataDocumentParser.h',
1133
            'dom/DeviceMotionClient.h',
1134
            'dom/DeviceMotionController.cpp',
1135
            'dom/DeviceMotionController.h',
1136
            'dom/DeviceMotionData.cpp',
1137
            'dom/DeviceMotionData.h',
1138
            'dom/DeviceMotionEvent.cpp',
1139
            'dom/DeviceMotionEvent.h',
1130
            'dom/DeviceOrientation.cpp',
1140
            'dom/DeviceOrientation.cpp',
1131
            'dom/DeviceOrientation.h',
1141
            'dom/DeviceOrientation.h',
1132
            'dom/DeviceOrientationClient.h',
1142
            'dom/DeviceOrientationClient.h',
- a/WebCore/WebCore.pri +1 lines
Lines 293-298 IDL_BINDINGS += \ a/WebCore/WebCore.pri_sec1
293
    dom/Comment.idl \
293
    dom/Comment.idl \
294
    dom/CompositionEvent.idl \
294
    dom/CompositionEvent.idl \
295
    dom/CustomEvent.idl \
295
    dom/CustomEvent.idl \
296
    dom/DeviceMotionEvent.idl \
296
    dom/DeviceOrientationEvent.idl \
297
    dom/DeviceOrientationEvent.idl \
297
    dom/DocumentFragment.idl \
298
    dom/DocumentFragment.idl \
298
    dom/Document.idl \
299
    dom/Document.idl \
- a/WebCore/WebCore.pro +8 lines
Lines 301-306 SOURCES += \ a/WebCore/WebCore.pro_sec1
301
    bindings/js/JSDataGridDataSource.cpp \
301
    bindings/js/JSDataGridDataSource.cpp \
302
    bindings/js/JSDebugWrapperSet.cpp \
302
    bindings/js/JSDebugWrapperSet.cpp \
303
    bindings/js/JSDesktopNotificationsCustom.cpp \
303
    bindings/js/JSDesktopNotificationsCustom.cpp \
304
    bindings/js/JSDeviceMotionEventCustom.cpp \
304
    bindings/js/JSDeviceOrientationEventCustom.cpp \
305
    bindings/js/JSDeviceOrientationEventCustom.cpp \
305
    bindings/js/JSDocumentCustom.cpp \
306
    bindings/js/JSDocumentCustom.cpp \
306
    bindings/js/JSDOMFormDataCustom.cpp \
307
    bindings/js/JSDOMFormDataCustom.cpp \
Lines 479-484 SOURCES += \ a/WebCore/WebCore.pro_sec2
479
    dom/CSSMappedAttributeDeclaration.cpp \
480
    dom/CSSMappedAttributeDeclaration.cpp \
480
    dom/CustomEvent.cpp \
481
    dom/CustomEvent.cpp \
481
    dom/DecodedDataDocumentParser.cpp \
482
    dom/DecodedDataDocumentParser.cpp \
483
    dom/DeviceMotionController.cpp \
484
    dom/DeviceMotionData.cpp \
485
    dom/DeviceMotionEvent.cpp \
482
    dom/DeviceOrientation.cpp \
486
    dom/DeviceOrientation.cpp \
483
    dom/DeviceOrientationController.cpp \
487
    dom/DeviceOrientationController.cpp \
484
    dom/DeviceOrientationEvent.cpp \
488
    dom/DeviceOrientationEvent.cpp \
Lines 1243-1248 HEADERS += \ a/WebCore/WebCore.pro_sec3
1243
    dom/CSSMappedAttributeDeclaration.h \
1247
    dom/CSSMappedAttributeDeclaration.h \
1244
    dom/CustomEvent.h \
1248
    dom/CustomEvent.h \
1245
    dom/default/PlatformMessagePortChannel.h \
1249
    dom/default/PlatformMessagePortChannel.h \
1250
    dom/DeviceMotionClient.h \
1251
    dom/DeviceMotionData.h \
1252
    dom/DeviceMotionController.h \
1253
    dom/DeviceMotionEvent.h \
1246
    dom/DeviceOrientation.h \
1254
    dom/DeviceOrientation.h \
1247
    dom/DeviceOrientationClient.h \
1255
    dom/DeviceOrientationClient.h \
1248
    dom/DeviceOrientationController.h \
1256
    dom/DeviceOrientationController.h \
- a/WebCore/WebCore.vcproj/WebCore.vcproj +136 lines
Lines 2905-2910 a/WebCore/WebCore.vcproj/WebCore.vcproj_sec1
2905
				>
2905
				>
2906
			</File>
2906
			</File>
2907
			<File
2907
			<File
2908
				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\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\$(ProjectName)\DerivedSources\JSDeviceMotionEvent.h"
2961
				>
2962
			</File>
2963
			<File
2908
				RelativePath="$(WebKitOutputDir)\obj\WebCore\DerivedSources\JSDeviceOrientationEvent.cpp"
2964
				RelativePath="$(WebKitOutputDir)\obj\WebCore\DerivedSources\JSDeviceOrientationEvent.cpp"
2909
				>
2965
				>
2910
				<FileConfiguration
2966
				<FileConfiguration
Lines 32653-32658 a/WebCore/WebCore.vcproj/WebCore.vcproj_sec2
32653
				>
32709
				>
32654
			</File>
32710
			</File>
32655
			<File
32711
			<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
32656
				RelativePath="..\dom\DeviceOrientation.cpp"
32740
				RelativePath="..\dom\DeviceOrientation.cpp"
32657
				>
32741
				>
32658
			</File>
32742
			</File>
Lines 42448-42453 a/WebCore/WebCore.vcproj/WebCore.vcproj_sec3
42448
					</FileConfiguration>
42532
					</FileConfiguration>
42449
				</File>
42533
				</File>
42450
				<File
42534
				<File
42535
					RelativePath="..\bindings\js\JSDeviceMotionEventCustom.cpp"
42536
					>
42537
					<FileConfiguration
42538
						Name="Debug|Win32"
42539
						ExcludedFromBuild="true"
42540
						>
42541
						<Tool
42542
							Name="VCCLCompilerTool"
42543
						/>
42544
					</FileConfiguration>
42545
					<FileConfiguration
42546
						Name="Release|Win32"
42547
						ExcludedFromBuild="true"
42548
						>
42549
						<Tool
42550
							Name="VCCLCompilerTool"
42551
						/>
42552
					</FileConfiguration>
42553
					<FileConfiguration
42554
						Name="Debug_Internal|Win32"
42555
						ExcludedFromBuild="true"
42556
						>
42557
						<Tool
42558
							Name="VCCLCompilerTool"
42559
						/>
42560
					</FileConfiguration>
42561
					<FileConfiguration
42562
						Name="Debug_Cairo|Win32"
42563
						ExcludedFromBuild="true"
42564
						>
42565
						<Tool
42566
							Name="VCCLCompilerTool"
42567
						/>
42568
					</FileConfiguration>
42569
					<FileConfiguration
42570
						Name="Release_Cairo|Win32"
42571
						ExcludedFromBuild="true"
42572
						>
42573
						<Tool
42574
							Name="VCCLCompilerTool"
42575
						/>
42576
					</FileConfiguration>
42577
					<FileConfiguration
42578
						Name="Debug_All|Win32"
42579
						ExcludedFromBuild="true"
42580
						>
42581
						<Tool
42582
							Name="VCCLCompilerTool"
42583
						/>
42584
					</FileConfiguration>
42585
				</File>
42586
				<File
42451
					RelativePath="..\bindings\js\JSDeviceOrientationEventCustom.cpp"
42587
					RelativePath="..\bindings\js\JSDeviceOrientationEventCustom.cpp"
42452
					>
42588
					>
42453
					<FileConfiguration
42589
					<FileConfiguration
- a/WebCore/WebCore.xcodeproj/project.pbxproj +43 lines
Lines 750-755 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
750
		31C0FF4C0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */; };
750
		31C0FF4C0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */; };
751
		31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
751
		31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
752
		31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
752
		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 */; };
753
		3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */; };
763
		3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3314ACE910892086000F0E56 /* JSExceptionBase.cpp */; };
754
		3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3314ACEA10892086000F0E56 /* JSExceptionBase.h */; };
764
		3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3314ACEA10892086000F0E56 /* JSExceptionBase.h */; };
755
		33503C9A10179A74003B47E1 /* NotificationPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationPresenter.h */; settings = {ATTRIBUTES = (Private, ); }; };
765
		33503C9A10179A74003B47E1 /* NotificationPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationPresenter.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 6469-6474 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
6469
		31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEvent.h; sourceTree = "<group>"; };
6479
		31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEvent.h; sourceTree = "<group>"; };
6470
		31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitTransitionEvent.mm; sourceTree = "<group>"; };
6480
		31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitTransitionEvent.mm; sourceTree = "<group>"; };
6471
		31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
6481
		31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
6482
		31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionClient.h; sourceTree = "<group>"; };
6483
		31FB1A50120A5D0600DC02A0 /* DeviceMotionController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionController.cpp; sourceTree = "<group>"; };
6484
		31FB1A51120A5D0600DC02A0 /* DeviceMotionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionController.h; sourceTree = "<group>"; };
6485
		31FB1A52120A5D0600DC02A0 /* DeviceMotionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionData.cpp; sourceTree = "<group>"; };
6486
		31FB1A53120A5D0600DC02A0 /* DeviceMotionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionData.h; sourceTree = "<group>"; };
6487
		31FB1A54120A5D0600DC02A0 /* DeviceMotionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceMotionEvent.cpp; sourceTree = "<group>"; };
6488
		31FB1A55120A5D0600DC02A0 /* DeviceMotionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionEvent.h; sourceTree = "<group>"; };
6489
		31FB1A56120A5D0600DC02A0 /* DeviceMotionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceMotionEvent.idl; sourceTree = "<group>"; };
6490
		31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEvent.cpp; sourceTree = "<group>"; };
6491
		31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDeviceMotionEvent.h; sourceTree = "<group>"; };
6492
		31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceMotionEventCustom.cpp; sourceTree = "<group>"; };
6472
		3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
6493
		3314ACE910892086000F0E56 /* JSExceptionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSExceptionBase.cpp; sourceTree = "<group>"; };
6473
		3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
6494
		3314ACEA10892086000F0E56 /* JSExceptionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExceptionBase.h; sourceTree = "<group>"; };
6474
		333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notification.idl; path = notifications/Notification.idl; sourceTree = "<group>"; };
6495
		333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notification.idl; path = notifications/Notification.idl; sourceTree = "<group>"; };
Lines 14736-14741 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
14736
				93F9B6DF0BA0FB7200854064 /* JSComment.h */,
14757
				93F9B6DF0BA0FB7200854064 /* JSComment.h */,
14737
				FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */,
14758
				FE6FD48B0F676E9300092873 /* JSCoordinates.cpp */,
14738
				FE6FD48C0F676E9300092873 /* JSCoordinates.h */,
14759
				FE6FD48C0F676E9300092873 /* JSCoordinates.h */,
14760
				31FB1A63120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp */,
14761
				31FB1A64120A5D3F00DC02A0 /* JSDeviceMotionEvent.h */,
14739
				59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */,
14762
				59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */,
14740
				59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */,
14763
				59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */,
14741
				659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
14764
				659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
Lines 15918-15923 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
15918
				BC77D1510FF19C730070887B /* JSDataGridColumnListCustom.cpp */,
15941
				BC77D1510FF19C730070887B /* JSDataGridColumnListCustom.cpp */,
15919
				4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
15942
				4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
15920
				33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
15943
				33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
15944
				31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
15921
				590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
15945
				590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
15922
				49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
15946
				49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
15923
				1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
15947
				1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
Lines 17068-17073 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
17068
				BC64641A11D7F416006455B0 /* DatasetDOMStringMap.h */,
17092
				BC64641A11D7F416006455B0 /* DatasetDOMStringMap.h */,
17069
				A8C228A011D5722E00D5A7D3 /* DecodedDataDocumentParser.cpp */,
17093
				A8C228A011D5722E00D5A7D3 /* DecodedDataDocumentParser.cpp */,
17070
				A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */,
17094
				A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */,
17095
				31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */,
17096
				31FB1A50120A5D0600DC02A0 /* DeviceMotionController.cpp */,
17097
				31FB1A51120A5D0600DC02A0 /* DeviceMotionController.h */,
17098
				31FB1A52120A5D0600DC02A0 /* DeviceMotionData.cpp */,
17099
				31FB1A53120A5D0600DC02A0 /* DeviceMotionData.h */,
17100
				31FB1A54120A5D0600DC02A0 /* DeviceMotionEvent.cpp */,
17101
				31FB1A55120A5D0600DC02A0 /* DeviceMotionEvent.h */,
17102
				31FB1A56120A5D0600DC02A0 /* DeviceMotionEvent.idl */,
17071
				59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */,
17103
				59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */,
17072
				590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */,
17104
				590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */,
17073
				59A8F1D711A69520001AC34A /* DeviceOrientationClient.h */,
17105
				59A8F1D711A69520001AC34A /* DeviceOrientationClient.h */,
Lines 19990-19995 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
19990
				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
20022
				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
19991
				CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
20023
				CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
19992
				37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
20024
				37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
20025
				31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */,
20026
				31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */,
20027
				31FB1A5B120A5D0600DC02A0 /* DeviceMotionData.h in Headers */,
20028
				31FB1A5D120A5D0600DC02A0 /* DeviceMotionEvent.h in Headers */,
20029
				31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */,
19993
			);
20030
			);
19994
			runOnlyForDeploymentPostprocessing = 0;
20031
			runOnlyForDeploymentPostprocessing = 0;
19995
		};
20032
		};
Lines 20049-20054 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec7
20049
			isa = PBXProject;
20086
			isa = PBXProject;
20050
			buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
20087
			buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
20051
			compatibilityVersion = "Xcode 2.4";
20088
			compatibilityVersion = "Xcode 2.4";
20089
			developmentRegion = English;
20052
			hasScannedForEncodings = 1;
20090
			hasScannedForEncodings = 1;
20053
			knownRegions = (
20091
			knownRegions = (
20054
				English,
20092
				English,
Lines 22394-22399 a/WebCore/WebCore.xcodeproj/project.pbxproj_sec8
22394
				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
22432
				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
22395
				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
22433
				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
22396
				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
22434
				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
22435
				31FB1A58120A5D0600DC02A0 /* DeviceMotionController.cpp in Sources */,
22436
				31FB1A5A120A5D0600DC02A0 /* DeviceMotionData.cpp in Sources */,
22437
				31FB1A5C120A5D0600DC02A0 /* DeviceMotionEvent.cpp in Sources */,
22438
				31FB1A65120A5D3F00DC02A0 /* JSDeviceMotionEvent.cpp in Sources */,
22439
				31FB1A6C120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp in Sources */,
22397
			);
22440
			);
22398
			runOnlyForDeploymentPostprocessing = 0;
22441
			runOnlyForDeploymentPostprocessing = 0;
22399
		};
22442
		};
- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp +1 lines
Lines 47-52 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false; a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp_sec1
47
bool RuntimeEnabledFeatures::isWebGLEnabled = false;
47
bool RuntimeEnabledFeatures::isWebGLEnabled = false;
48
bool RuntimeEnabledFeatures::isPushStateEnabled = false;
48
bool RuntimeEnabledFeatures::isPushStateEnabled = false;
49
bool RuntimeEnabledFeatures::isTouchEnabled = true;
49
bool RuntimeEnabledFeatures::isTouchEnabled = true;
50
bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
50
bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
51
bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
51
bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
52
bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
52
53
- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h +6 lines
Lines 114-119 public: a/WebCore/bindings/generic/RuntimeEnabledFeatures.h_sec1
114
    static bool ontouchcancelEnabled() { return isTouchEnabled; }
114
    static bool ontouchcancelEnabled() { return isTouchEnabled; }
115
#endif
115
#endif
116
116
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
    
117
    static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
122
    static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
118
    static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
123
    static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
119
    static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
124
    static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
Lines 136-141 private: a/WebCore/bindings/generic/RuntimeEnabledFeatures.h_sec2
136
    static bool isWebGLEnabled;
141
    static bool isWebGLEnabled;
137
    static bool isPushStateEnabled;
142
    static bool isPushStateEnabled;
138
    static bool isTouchEnabled;
143
    static bool isTouchEnabled;
144
    static bool isDeviceMotionEnabled;
139
    static bool isDeviceOrientationEnabled;
145
    static bool isDeviceOrientationEnabled;
140
    static bool isSpeechInputEnabled;
146
    static bool isSpeechInputEnabled;
141
};
147
};
- a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp +129 lines
Line 0 a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "JSDeviceMotionEvent.h"
28
29
#if ENABLE(DEVICE_ORIENTATION)
30
31
#include "DeviceMotionData.h"
32
#include "DeviceMotionEvent.h"
33
34
using namespace JSC;
35
36
namespace WebCore {
37
38
JSValue JSDeviceMotionEvent::xAcceleration(ExecState* exec) const
39
{
40
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
41
    if (!imp->deviceMotionData()->canProvideXAcceleration())
42
        return jsNull();
43
    return jsNumber(exec, imp->deviceMotionData()->xAcceleration());
44
}
45
46
JSValue JSDeviceMotionEvent::yAcceleration(ExecState* exec) const
47
{
48
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
49
    if (!imp->deviceMotionData()->canProvideYAcceleration())
50
        return jsNull();
51
    return jsNumber(exec, imp->deviceMotionData()->yAcceleration());
52
}
53
54
JSValue JSDeviceMotionEvent::zAcceleration(ExecState* exec) const
55
{
56
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
57
    if (!imp->deviceMotionData()->canProvideZAcceleration())
58
        return jsNull();
59
    return jsNumber(exec, imp->deviceMotionData()->zAcceleration());
60
}
61
62
JSValue JSDeviceMotionEvent::xRotationRate(ExecState* exec) const
63
{
64
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
65
    if (!imp->deviceMotionData()->canProvideXRotationRate())
66
        return jsNull();
67
    return jsNumber(exec, imp->deviceMotionData()->xRotationRate());
68
}
69
70
JSValue JSDeviceMotionEvent::yRotationRate(ExecState* exec) const
71
{
72
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
73
    if (!imp->deviceMotionData()->canProvideYRotationRate())
74
        return jsNull();
75
    return jsNumber(exec, imp->deviceMotionData()->yRotationRate());
76
}
77
78
JSValue JSDeviceMotionEvent::zRotationRate(ExecState* exec) const
79
{
80
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
81
    if (!imp->deviceMotionData()->canProvideZRotationRate())
82
        return jsNull();
83
    return jsNumber(exec, imp->deviceMotionData()->zRotationRate());
84
}
85
    
86
JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
87
{
88
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
89
    if (!imp->deviceMotionData()->canProvideInterval())
90
        return jsNull();
91
    return jsNumber(exec, imp->deviceMotionData()->interval());
92
}
93
    
94
JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
95
{
96
    const String& type = ustringToString(exec->argument(0).toString(exec));
97
    bool bubbles = exec->argument(1).toBoolean(exec);
98
    bool cancelable = exec->argument(2).toBoolean(exec);
99
    // If any of the parameters are null or undefined, mark them as not provided.
100
    // Otherwise, use the standard JavaScript conversion.
101
    bool xAccelerationProvided = !exec->argument(3).isUndefinedOrNull();
102
    double xAcceleration = exec->argument(3).toNumber(exec);
103
    bool yAccelerationProvided = !exec->argument(4).isUndefinedOrNull();
104
    double yAcceleration = exec->argument(4).toNumber(exec);
105
    bool zAccelerationProvided = !exec->argument(5).isUndefinedOrNull();
106
    double zAcceleration = exec->argument(5).toNumber(exec);
107
    bool xRotationRateProvided = !exec->argument(6).isUndefinedOrNull();
108
    double xRotationRate = exec->argument(6).toNumber(exec);
109
    bool yRotationRateProvided = !exec->argument(7).isUndefinedOrNull();
110
    double yRotationRate = exec->argument(7).toNumber(exec);
111
    bool zRotationRateProvided = !exec->argument(8).isUndefinedOrNull();
112
    double zRotationRate = exec->argument(8).toNumber(exec);
113
    bool intervalProvided = !exec->argument(9).isUndefinedOrNull();
114
    double interval = exec->argument(9).toNumber(exec);
115
    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration,
116
                                                                         yAccelerationProvided, yAcceleration,
117
                                                                         zAccelerationProvided, zAcceleration,
118
                                                                         xRotationRateProvided, xRotationRate,
119
                                                                         yRotationRateProvided, yRotationRate,
120
                                                                         zRotationRateProvided, zRotationRate,
121
                                                                         intervalProvided, interval);
122
    DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
123
    imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
124
    return jsUndefined();
125
}
126
127
} // namespace WebCore
128
129
#endif // ENABLE(DEVICE_ORIENTATION)
- a/WebCore/bindings/js/JSEventCustom.cpp +5 lines
Lines 32-43 a/WebCore/bindings/js/JSEventCustom.cpp_sec1
32
#include "Clipboard.h"
32
#include "Clipboard.h"
33
#include "CompositionEvent.h"
33
#include "CompositionEvent.h"
34
#include "CustomEvent.h"
34
#include "CustomEvent.h"
35
#include "DeviceMotionEvent.h"
35
#include "DeviceOrientationEvent.h"
36
#include "DeviceOrientationEvent.h"
36
#include "Event.h"
37
#include "Event.h"
38
#include "JSDeviceMotionEvent.h"
37
#include "JSBeforeLoadEvent.h"
39
#include "JSBeforeLoadEvent.h"
38
#include "JSClipboard.h"
40
#include "JSClipboard.h"
39
#include "JSCustomEvent.h"
41
#include "JSCustomEvent.h"
40
#include "JSCompositionEvent.h"
42
#include "JSCompositionEvent.h"
43
#include "JSDeviceMotionEvent.h"
41
#include "JSDeviceOrientationEvent.h"
44
#include "JSDeviceOrientationEvent.h"
42
#include "JSErrorEvent.h"
45
#include "JSErrorEvent.h"
43
#include "JSKeyboardEvent.h"
46
#include "JSKeyboardEvent.h"
Lines 173-178 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event) a/WebCore/bindings/js/JSEventCustom.cpp_sec2
173
    else if (event->isCustomEvent())
176
    else if (event->isCustomEvent())
174
        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CustomEvent, event);
177
        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CustomEvent, event);
175
#if ENABLE(DEVICE_ORIENTATION)
178
#if ENABLE(DEVICE_ORIENTATION)
179
    else if (event->isDeviceMotionEvent())
180
        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceMotionEvent, event);
176
    else if (event->isDeviceOrientationEvent())
181
    else if (event->isDeviceOrientationEvent())
177
        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceOrientationEvent, event);
182
        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceOrientationEvent, event);
178
#endif
183
#endif
- a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp +139 lines
Line 0 a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "V8DeviceMotionEvent.h"
28
29
#if ENABLE(DEVICE_ORIENTATION)
30
31
#include "DeviceMotionData.h"
32
#include "V8Binding.h"
33
#include "V8Proxy.h"
34
35
#include <v8.h>
36
37
namespace WebCore {
38
39
v8::Handle<v8::Value> V8DeviceMotionEvent::xAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
40
{
41
    INC_STATS("DOM.DeviceMotionEvent.xAcceleration._get");
42
    v8::Handle<v8::Object> holder = info.Holder();
43
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
44
    if (!imp->deviceMotionData()->canProvideXAcceleration())
45
        return v8::Null();
46
    return v8::Number::New(imp->deviceMotionData()->xAcceleration());
47
}
48
49
v8::Handle<v8::Value> V8DeviceMotionEvent::yAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
50
{
51
    INC_STATS("DOM.DeviceMotionEvent.yAcceleration._get");
52
    v8::Handle<v8::Object> holder = info.Holder();
53
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
54
    if (!imp->deviceMotionData()->canProvideYAcceleration())
55
        return v8::Null();
56
    return v8::Number::New(imp->deviceMotionData()->yAcceleration());
57
}
58
59
v8::Handle<v8::Value> V8DeviceMotionEvent::zAccelerationAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
60
{
61
    INC_STATS("DOM.DeviceMotionEvent.zAcceleration._get");
62
    v8::Handle<v8::Object> holder = info.Holder();
63
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
64
    if (!imp->deviceMotionData()->canProvideZAcceleration())
65
        return v8::Null();
66
    return v8::Number::New(imp->deviceMotionData()->zAcceleration());
67
}
68
69
v8::Handle<v8::Value> V8DeviceMotionEvent::xRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
70
{
71
    INC_STATS("DOM.DeviceMotionEvent.xRotationRate._get");
72
    v8::Handle<v8::Object> holder = info.Holder();
73
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
74
    if (!imp->deviceMotionData()->canProvideXRotationRate())
75
        return v8::Null();
76
    return v8::Number::New(imp->deviceMotionData()->xRotationRate());
77
}
78
79
v8::Handle<v8::Value> V8DeviceMotionEvent::yRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
80
{
81
    INC_STATS("DOM.DeviceMotionEvent.yRotationRate._get");
82
    v8::Handle<v8::Object> holder = info.Holder();
83
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
84
    if (!imp->deviceMotionData()->canProvideYRotationRate())
85
        return v8::Null();
86
    return v8::Number::New(imp->deviceMotionData()->yRotationRate());
87
}
88
89
v8::Handle<v8::Value> V8DeviceMotionEvent::zRotationRateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
90
{
91
    INC_STATS("DOM.DeviceMotionEvent.zRotationRate._get");
92
    v8::Handle<v8::Object> holder = info.Holder();
93
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
94
    if (!imp->deviceMotionData()->canProvideZRotationRate())
95
        return v8::Null();
96
    return v8::Number::New(imp->deviceMotionData()->zRotationRate());
97
}
98
99
100
v8::Handle<v8::Value> V8DeviceMotionEvent::intervalAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
101
{
102
    INC_STATS("DOM.DeviceMotionEvent.interval._get");
103
    v8::Handle<v8::Object> holder = info.Holder();
104
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(holder);
105
    if (!imp->deviceMotionData()->canProvideInterval())
106
        return v8::Null();
107
    return v8::Number::New(imp->deviceMotionData()->interval());
108
}
109
110
v8::Handle<v8::Value> V8DeviceMotionEvent::initDeviceMotionEventCallback(const v8::Arguments& args)
111
{
112
    DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(args.Holder());
113
    V8Parameter<> type = args[0];
114
    bool bubbles = args[1]->BooleanValue();
115
    bool cancelable = args[2]->BooleanValue();
116
    // If any of the parameters are null or undefined, mark them as not provided.
117
    // Otherwise, use the standard JavaScript conversion.
118
    bool xAccelerationProvided = !isUndefinedOrNull(args[3]);
119
    double xAcceleration = static_cast<double>(args[3]->NumberValue());
120
    bool yAccelerationProvided = !isUndefinedOrNull(args[4]);
121
    double yAcceleration = static_cast<double>(args[4]->NumberValue());
122
    bool zAccelerationProvided = !isUndefinedOrNull(args[5]);
123
    double zAcceleration = static_cast<double>(args[5]->NumberValue());
124
    bool xRotationRateProvided = !isUndefinedOrNull(args[6]);
125
    double xRotationRate = static_cast<double>(args[6]->NumberValue());
126
    bool yRotationRateProvided = !isUndefinedOrNull(args[7]);
127
    double yRotationRate = static_cast<double>(args[7]->NumberValue());
128
    bool zRotationRateProvided = !isUndefinedOrNull(args[8]);
129
    double zRotationRate = static_cast<double>(args[8]->NumberValue());
130
    bool intervalProvided = !isUndefinedOrNull(args[9]);
131
    double interval = static_cast<double>(args[9]->NumberValue());
132
    RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(xAccelerationProvided, xAcceleration, yAccelerationProvided, yAcceleration, zAccelerationProvided, zAcceleration, xRotationRateProvided, xRotationRate, yRotationRateProvided, yRotationRate, zRotationRateProvided, zRotationRate, intervalProvided, interval);
133
    imp->initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
134
    return v8::Handle<v8::Value>();
135
}
136
137
} // namespace WebCore
138
139
#endif // ENABLE(DEVICE_ORIENTATION)
- a/WebCore/dom/DeviceMotionClient.h +45 lines
Line 0 a/WebCore/dom/DeviceMotionClient.h_sec1
1
/*
2
 * Copyright 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef DeviceMotionClient_h
27
#define DeviceMotionClient_h
28
29
namespace WebCore {
30
31
class DeviceMotionController;
32
class DeviceMotionData;
33
34
class DeviceMotionClient {
35
public:
36
    virtual ~DeviceMotionClient() {}
37
    virtual void setController(DeviceMotionController*) = 0;
38
    virtual void startUpdating() = 0;
39
    virtual void stopUpdating() = 0;
40
    virtual DeviceMotionData* currentDeviceMotion() const = 0;
41
};
42
43
} // namespace WebCore
44
45
#endif // DeviceMotionClient_h
- a/WebCore/dom/DeviceMotionController.cpp +104 lines
Line 0 a/WebCore/dom/DeviceMotionController.cpp_sec1
1
/*
2
 * Copyright 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "DeviceMotionController.h"
28
29
#include "DeviceMotionClient.h"
30
#include "DeviceMotionData.h"
31
#include "DeviceMotionEvent.h"
32
33
namespace WebCore {
34
35
DeviceMotionController::DeviceMotionController(DeviceMotionClient* client)
36
    : m_client(client)
37
    , m_timer(this, &DeviceMotionController::timerFired)
38
{
39
    if (m_client)
40
        m_client->setController(this);
41
}
42
43
void DeviceMotionController::timerFired(Timer<DeviceMotionController>* timer)
44
{
45
    ASSERT_UNUSED(timer, timer == &m_timer);
46
    ASSERT(!m_client || m_client->currentDeviceMotion());
47
    m_timer.stop();
48
    
49
    RefPtr<DeviceMotionData> deviceMotionData = m_client ? m_client->currentDeviceMotion() : DeviceMotionData::create();
50
    RefPtr<DeviceMotionEvent> event = DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionData.get());
51
 
52
    Vector<DOMWindow*> listenersVector;
53
    copyToVector(m_newListeners, listenersVector);
54
    m_newListeners.clear();
55
    for (size_t i = 0; i < listenersVector.size(); ++i)
56
        listenersVector[i]->dispatchEvent(event);
57
}
58
    
59
void DeviceMotionController::addListener(DOMWindow* window)
60
{
61
    // If no client is present or the client already has motion data,
62
    // immediately trigger an asynchronous response.
63
    if (!m_client || m_client->currentDeviceMotion()) {
64
        m_newListeners.add(window);
65
        if (!m_timer.isActive())
66
            m_timer.startOneShot(0);
67
    }
68
    
69
    bool wasEmpty = m_listeners.isEmpty();
70
    m_listeners.add(window);
71
    if (wasEmpty && m_client)
72
        m_client->startUpdating();
73
}
74
75
void DeviceMotionController::removeListener(DOMWindow* window)
76
{
77
    m_listeners.remove(window);
78
    m_newListeners.remove(window);
79
    if (m_listeners.isEmpty() && m_client)
80
        m_client->stopUpdating();
81
}
82
83
void DeviceMotionController::removeAllListeners(DOMWindow* window)
84
{
85
    // May be called with a DOMWindow that's not a listener.
86
    if (!m_listeners.contains(window))
87
        return;
88
89
    m_listeners.removeAll(window);
90
    m_newListeners.remove(window);
91
    if (m_listeners.isEmpty() && m_client)
92
        m_client->stopUpdating();
93
}
94
95
void DeviceMotionController::didChangeDeviceMotion(DeviceMotionData* deviceMotionData)
96
{
97
    RefPtr<DeviceMotionEvent> event = DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionData);
98
    Vector<DOMWindow*> listenersVector;
99
    copyToVector(m_listeners, listenersVector);
100
    for (size_t i = 0; i < listenersVector.size(); ++i)
101
        listenersVector[i]->dispatchEvent(event);
102
}
103
104
} // namespace WebCore
- a/WebCore/dom/DeviceMotionController.h +61 lines
Line 0 a/WebCore/dom/DeviceMotionController.h_sec1
1
/*
2
 * Copyright 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef DeviceMotionController_h
27
#define DeviceMotionController_h
28
29
#include "DOMWindow.h"
30
#include "Timer.h"
31
#include <wtf/HashCountedSet.h>
32
33
namespace WebCore {
34
35
class DeviceMotionData;
36
class DeviceMotionClient;
37
38
class DeviceMotionController {
39
public:
40
    DeviceMotionController(DeviceMotionClient*);
41
42
    void addListener(DOMWindow*);
43
    void removeListener(DOMWindow*);
44
    void removeAllListeners(DOMWindow*);
45
46
    void didChangeDeviceMotion(DeviceMotionData*);
47
48
private:
49
    void timerFired(Timer<DeviceMotionController>*);
50
    
51
    DeviceMotionClient* m_client;
52
    typedef HashCountedSet<DOMWindow*> ListenersCountedSet;
53
    ListenersCountedSet m_listeners;
54
    typedef HashSet<DOMWindow*> ListenersSet;
55
    ListenersSet m_newListeners;
56
    Timer<DeviceMotionController> m_timer;
57
};
58
59
} // namespace WebCore
60
61
#endif // DeviceMotionController_h
- a/WebCore/dom/DeviceMotionData.cpp +88 lines
Line 0 a/WebCore/dom/DeviceMotionData.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "DeviceMotionData.h"
28
29
namespace WebCore {
30
31
PassRefPtr<DeviceMotionData> DeviceMotionData::create()
32
{
33
    return adoptRef(new DeviceMotionData);
34
}
35
36
PassRefPtr<DeviceMotionData> DeviceMotionData::create(bool canProvideXAcceleration, double xAcceleration,
37
                                                      bool canProvideYAcceleration, double yAcceleration,
38
                                                      bool canProvideZAcceleration, double zAcceleration,
39
                                                      bool canProvideXRotationRate, double xRotationRate,
40
                                                      bool canProvideYRotationRate, double yRotationRate,
41
                                                      bool canProvideZRotationRate, double zRotationRate,
42
                                                      bool canProvideInterval, double interval)
43
{
44
    return adoptRef(new DeviceMotionData(canProvideXAcceleration, xAcceleration,
45
                                         canProvideYAcceleration, yAcceleration,
46
                                         canProvideZAcceleration, zAcceleration,
47
                                         canProvideXRotationRate, xRotationRate,
48
                                         canProvideYRotationRate, yRotationRate,
49
                                         canProvideZRotationRate, zRotationRate,
50
                                         canProvideInterval, interval));
51
}
52
53
DeviceMotionData::DeviceMotionData()
54
    : m_canProvideXAcceleration(false)
55
    , m_canProvideYAcceleration(false)
56
    , m_canProvideZAcceleration(false)
57
    , m_canProvideXRotationRate(false)
58
    , m_canProvideYRotationRate(false)
59
    , m_canProvideZRotationRate(false)
60
    , m_canProvideInterval(false)
61
{
62
}
63
64
DeviceMotionData::DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
65
                                   bool canProvideYAcceleration, double yAcceleration,
66
                                   bool canProvideZAcceleration, double zAcceleration,
67
                                   bool canProvideXRotationRate, double xRotationRate,
68
                                   bool canProvideYRotationRate, double yRotationRate,
69
                                   bool canProvideZRotationRate, double zRotationRate,
70
                                   bool canProvideInterval, double interval)
71
    : m_canProvideXAcceleration(canProvideXAcceleration)
72
    , m_canProvideYAcceleration(canProvideYAcceleration)
73
    , m_canProvideZAcceleration(canProvideZAcceleration)
74
    , m_canProvideXRotationRate(canProvideXRotationRate)
75
    , m_canProvideYRotationRate(canProvideYRotationRate)
76
    , m_canProvideZRotationRate(canProvideZRotationRate)
77
    , m_canProvideInterval(canProvideInterval)
78
    , m_xAcceleration(xAcceleration)
79
    , m_yAcceleration(yAcceleration)
80
    , m_zAcceleration(zAcceleration)
81
    , m_xRotationRate(xRotationRate)
82
    , m_yRotationRate(yRotationRate)
83
    , m_zRotationRate(zRotationRate)
84
    , m_interval(interval)
85
{
86
}
87
88
} // namespace WebCore
- a/WebCore/dom/DeviceMotionData.h +90 lines
Line 0 a/WebCore/dom/DeviceMotionData.h_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef DeviceMotionData_h
27
#define DeviceMotionData_h
28
29
#include <wtf/PassRefPtr.h>
30
#include <wtf/RefCounted.h>
31
32
namespace WebCore {
33
34
class DeviceMotionData : public RefCounted<DeviceMotionData> {
35
public:
36
    static PassRefPtr<DeviceMotionData> create();
37
    static PassRefPtr<DeviceMotionData> create(bool canProvideXAcceleration, double xAcceleration,
38
                                               bool canProvideYAcceleration, double yAcceleration,
39
                                               bool canProvideZAcceleration, double zAcceleration,
40
                                               bool canProvideXRotationRate, double xRotationRate,
41
                                               bool canProvideYRotationRate, double yRotationRate,
42
                                               bool canProvideZRotationRate, double zRotationRate,
43
                                               bool canProvideInterval, double interval);
44
45
    double xAcceleration() const { return m_xAcceleration; }
46
    double yAcceleration() const { return m_yAcceleration; }
47
    double zAcceleration() const { return m_zAcceleration; }
48
    double xRotationRate() const { return m_xRotationRate; }
49
    double yRotationRate() const { return m_yRotationRate; }
50
    double zRotationRate() const { return m_zRotationRate; }
51
    double interval() const { return m_interval; }
52
53
    bool canProvideXAcceleration() const { return m_canProvideXAcceleration; }
54
    bool canProvideYAcceleration() const { return m_canProvideYAcceleration; }
55
    bool canProvideZAcceleration() const { return m_canProvideZAcceleration; }
56
    bool canProvideXRotationRate() const { return m_canProvideXRotationRate; }
57
    bool canProvideYRotationRate() const { return m_canProvideYRotationRate; }
58
    bool canProvideZRotationRate() const { return m_canProvideZRotationRate; }
59
    bool canProvideInterval() const { return m_canProvideInterval; }
60
61
private:
62
    DeviceMotionData();
63
    DeviceMotionData(bool canProvideXAcceleration, double xAcceleration,
64
                     bool canProvideYAcceleration, double yAcceleration,
65
                     bool canProvideZAcceleration, double zAcceleration,
66
                     bool canProvideXRotationRate, double xRotationRate,
67
                     bool canProvideYRotationRate, double yRotationRate,
68
                     bool canProvideZRotationRate, double zRotationRate,
69
                     bool canProvideInterval, double interval);
70
71
    bool m_canProvideXAcceleration;
72
    bool m_canProvideYAcceleration;
73
    bool m_canProvideZAcceleration;
74
    bool m_canProvideXRotationRate;
75
    bool m_canProvideYRotationRate;
76
    bool m_canProvideZRotationRate;
77
    bool m_canProvideInterval;
78
79
    double m_xAcceleration;
80
    double m_yAcceleration;
81
    double m_zAcceleration;
82
    double m_xRotationRate;
83
    double m_yRotationRate;
84
    double m_zRotationRate;
85
    double m_interval;
86
};
87
88
} // namespace WebCore
89
90
#endif // DeviceMotionData_h
- a/WebCore/dom/DeviceMotionEvent.cpp +57 lines
Line 0 a/WebCore/dom/DeviceMotionEvent.cpp_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#include "config.h"
27
#include "DeviceMotionEvent.h"
28
29
#include "DeviceMotionData.h"
30
31
namespace WebCore {
32
33
DeviceMotionEvent::~DeviceMotionEvent()
34
{
35
}
36
37
DeviceMotionEvent::DeviceMotionEvent()
38
    : m_deviceMotionData(DeviceMotionData::create())
39
{
40
}
41
42
DeviceMotionEvent::DeviceMotionEvent(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
43
    : Event(eventType, false, false) // Can't bubble, not cancelable
44
    , m_deviceMotionData(deviceMotionData)
45
{
46
}
47
48
void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData* deviceMotionData)
49
{
50
    if (dispatched())
51
        return;
52
53
    initEvent(type, bubbles, cancelable);
54
    m_deviceMotionData = deviceMotionData;
55
}
56
57
} // namespace WebCore
- a/WebCore/dom/DeviceMotionEvent.h +62 lines
Line 0 a/WebCore/dom/DeviceMotionEvent.h_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
#ifndef DeviceMotionEvent_h
27
#define DeviceMotionEvent_h
28
29
#include "Event.h"
30
31
namespace WebCore {
32
33
class DeviceMotionData;
34
35
class DeviceMotionEvent : public Event {
36
public:
37
    ~DeviceMotionEvent();
38
    static PassRefPtr<DeviceMotionEvent> create()
39
    {
40
        return adoptRef(new DeviceMotionEvent);
41
    }
42
    static PassRefPtr<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
43
    {
44
        return adoptRef(new DeviceMotionEvent(eventType, deviceMotionData));
45
    }
46
47
    void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData*);
48
49
    virtual bool isDeviceMotionEvent() const { return true; }
50
51
    DeviceMotionData* deviceMotionData() const { return m_deviceMotionData.get(); }
52
53
private:
54
    DeviceMotionEvent();
55
    DeviceMotionEvent(const AtomicString& eventType, DeviceMotionData*);
56
57
    RefPtr<DeviceMotionData> m_deviceMotionData;
58
};
59
60
} // namespace WebCore
61
62
#endif // DeviceMotionEvent_h
- a/WebCore/dom/DeviceMotionEvent.idl +41 lines
Line 0 a/WebCore/dom/DeviceMotionEvent.idl_sec1
1
/*
2
 * Copyright (C) 2010 Apple Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
module core {
27
28
    interface [
29
        Conditional=DEVICE_ORIENTATION
30
    ] DeviceMotionEvent : Event {
31
        readonly attribute [Custom] double xAcceleration;
32
        readonly attribute [Custom] double yAcceleration;
33
        readonly attribute [Custom] double zAcceleration;
34
        readonly attribute [Custom] double xRotationRate;
35
        readonly attribute [Custom] double yRotationRate;
36
        readonly attribute [Custom] double zRotationRate;
37
        readonly attribute [Custom] double interval;
38
        [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);
39
    };
40
41
}
- a/WebCore/dom/DeviceOrientationController.cpp -2 / +2 lines
Lines 37-44 DeviceOrientationController::DeviceOrientationController(Page* page, DeviceOrien a/WebCore/dom/DeviceOrientationController.cpp_sec1
37
    , m_client(client)
37
    , m_client(client)
38
    , m_timer(this, &DeviceOrientationController::timerFired)
38
    , m_timer(this, &DeviceOrientationController::timerFired)
39
{
39
{
40
    ASSERT(m_client);
40
    if (m_client)
41
    m_client->setController(this);
41
        m_client->setController(this);
42
}
42
}
43
43
44
void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer)
44
void DeviceOrientationController::timerFired(Timer<DeviceOrientationController>* timer)
- a/WebCore/dom/Document.cpp +3 lines
Lines 44-49 a/WebCore/dom/Document.cpp_sec1
44
#include "CustomEvent.h"
44
#include "CustomEvent.h"
45
#include "DOMImplementation.h"
45
#include "DOMImplementation.h"
46
#include "DOMWindow.h"
46
#include "DOMWindow.h"
47
#include "DeviceMotionEvent.h"
47
#include "DeviceOrientationEvent.h"
48
#include "DeviceOrientationEvent.h"
48
#include "DocLoader.h"
49
#include "DocLoader.h"
49
#include "DocumentFragment.h"
50
#include "DocumentFragment.h"
Lines 3331-3336 PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionCode& a/WebCore/dom/Document.cpp_sec2
3331
        event = TouchEvent::create();
3332
        event = TouchEvent::create();
3332
#endif
3333
#endif
3333
#if ENABLE(DEVICE_ORIENTATION)
3334
#if ENABLE(DEVICE_ORIENTATION)
3335
    else if (eventType == "DeviceMotionEvent")
3336
        event = DeviceMotionEvent::create();
3334
    else if (eventType == "DeviceOrientationEvent")
3337
    else if (eventType == "DeviceOrientationEvent")
3335
        event = DeviceOrientationEvent::create();
3338
        event = DeviceOrientationEvent::create();
3336
#endif
3339
#endif
- a/WebCore/dom/Event.cpp +5 lines
Lines 213-218 bool Event::isTouchEvent() const a/WebCore/dom/Event.cpp_sec1
213
#endif
213
#endif
214
214
215
#if ENABLE(DEVICE_ORIENTATION)
215
#if ENABLE(DEVICE_ORIENTATION)
216
bool Event::isDeviceMotionEvent() const
217
{
218
    return false;
219
}
220
216
bool Event::isDeviceOrientationEvent() const
221
bool Event::isDeviceOrientationEvent() const
217
{
222
{
218
    return false;
223
    return false;
- a/WebCore/dom/Event.h +1 lines
Lines 140-145 namespace WebCore { a/WebCore/dom/Event.h_sec1
140
        virtual bool isTouchEvent() const;
140
        virtual bool isTouchEvent() const;
141
#endif
141
#endif
142
#if ENABLE(DEVICE_ORIENTATION)
142
#if ENABLE(DEVICE_ORIENTATION)
143
        virtual bool isDeviceMotionEvent() const;
143
        virtual bool isDeviceOrientationEvent() const;
144
        virtual bool isDeviceOrientationEvent() const;
144
#endif
145
#endif
145
        bool fromUserGesture();
146
        bool fromUserGesture();
- a/WebCore/dom/EventNames.h +1 lines
Lines 50-55 namespace WebCore { a/WebCore/dom/EventNames.h_sec1
50
    macro(copy) \
50
    macro(copy) \
51
    macro(cut) \
51
    macro(cut) \
52
    macro(dblclick) \
52
    macro(dblclick) \
53
    macro(devicemotion) \
53
    macro(deviceorientation) \
54
    macro(deviceorientation) \
54
    macro(display) \
55
    macro(display) \
55
    macro(downloading) \
56
    macro(downloading) \
- a/WebCore/page/DOMWindow.cpp +7 lines
Lines 42-47 a/WebCore/page/DOMWindow.cpp_sec1
42
#include "DOMTimer.h"
42
#include "DOMTimer.h"
43
#include "Database.h"
43
#include "Database.h"
44
#include "DatabaseCallback.h"
44
#include "DatabaseCallback.h"
45
#include "DeviceMotionController.h"
45
#include "DeviceOrientationController.h"
46
#include "DeviceOrientationController.h"
46
#include "PageTransitionEvent.h"
47
#include "PageTransitionEvent.h"
47
#include "Document.h"
48
#include "Document.h"
Lines 1435-1440 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event a/WebCore/page/DOMWindow.cpp_sec2
1435
    else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
1436
    else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
1436
        addBeforeUnloadEventListener(this);
1437
        addBeforeUnloadEventListener(this);
1437
#if ENABLE(DEVICE_ORIENTATION)
1438
#if ENABLE(DEVICE_ORIENTATION)
1439
    else if (eventType == eventNames().devicemotionEvent && frame() && frame()->page() && frame()->page()->deviceMotionController())
1440
        frame()->page()->deviceMotionController()->addListener(this);
1438
    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
1441
    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
1439
        frame()->page()->deviceOrientationController()->addListener(this);
1442
        frame()->page()->deviceOrientationController()->addListener(this);
1440
#endif
1443
#endif
Lines 1452-1457 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener a/WebCore/page/DOMWindow.cpp_sec3
1452
    else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
1455
    else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
1453
        removeBeforeUnloadEventListener(this);
1456
        removeBeforeUnloadEventListener(this);
1454
#if ENABLE(DEVICE_ORIENTATION)
1457
#if ENABLE(DEVICE_ORIENTATION)
1458
    else if (eventType == eventNames().devicemotionEvent && frame() && frame()->page() && frame()->page()->deviceMotionController())
1459
        frame()->page()->deviceMotionController()->removeListener(this);
1455
    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
1460
    else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
1456
        frame()->page()->deviceOrientationController()->removeListener(this);
1461
        frame()->page()->deviceOrientationController()->removeListener(this);
1457
#endif
1462
#endif
Lines 1530-1535 void DOMWindow::removeAllEventListeners() a/WebCore/page/DOMWindow.cpp_sec4
1530
    EventTarget::removeAllEventListeners();
1535
    EventTarget::removeAllEventListeners();
1531
1536
1532
#if ENABLE(DEVICE_ORIENTATION)
1537
#if ENABLE(DEVICE_ORIENTATION)
1538
    if (frame() && frame()->page() && frame()->page()->deviceMotionController())
1539
        frame()->page()->deviceMotionController()->removeAllListeners(this);
1533
    if (frame() && frame()->page() && frame()->page()->deviceOrientationController())
1540
    if (frame() && frame()->page() && frame()->page()->deviceOrientationController())
1534
        frame()->page()->deviceOrientationController()->removeAllListeners(this);
1541
        frame()->page()->deviceOrientationController()->removeAllListeners(this);
1535
#endif
1542
#endif
- a/WebCore/page/DOMWindow.h +1 lines
Lines 338-343 namespace WebCore { a/WebCore/page/DOMWindow.h_sec1
338
#endif
338
#endif
339
339
340
#if ENABLE(DEVICE_ORIENTATION)
340
#if ENABLE(DEVICE_ORIENTATION)
341
        DEFINE_ATTRIBUTE_EVENT_LISTENER(devicemotion);
341
        DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
342
        DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
342
#endif
343
#endif
343
344
- a/WebCore/page/DOMWindow.idl -2 / +4 lines
Lines 305-312 module window { a/WebCore/page/DOMWindow.idl_sec1
305
        attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
305
        attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
306
        attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
306
        attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
307
307
308
        attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
308
        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] DeviceMotionEventConstructor DeviceMotionEvent;
309
        attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] EventListener ondeviceorientation;
309
        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] EventListener ondevicemotion;
310
        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
311
        attribute [Conditional=DEVICE_ORIENTATION,EnabledAtRuntime] EventListener ondeviceorientation;
310
312
311
        // EventTarget interface
313
        // EventTarget interface
312
        [Custom] void addEventListener(in DOMString type,
314
        [Custom] void addEventListener(in DOMString type,
- a/WebCore/page/Page.cpp +2 lines
Lines 20-25 a/WebCore/page/Page.cpp_sec1
20
#include "config.h"
20
#include "config.h"
21
#include "Page.h"
21
#include "Page.h"
22
22
23
#include "DeviceMotionController.h"
23
#include "BackForwardController.h"
24
#include "BackForwardController.h"
24
#include "BackForwardList.h"
25
#include "BackForwardList.h"
25
#include "Base64.h"
26
#include "Base64.h"
Lines 141-146 Page::Page(const PageClients& pageClients) a/WebCore/page/Page.cpp_sec2
141
    , m_geolocationController(new GeolocationController(this, pageClients.geolocationControllerClient))
142
    , m_geolocationController(new GeolocationController(this, pageClients.geolocationControllerClient))
142
#endif
143
#endif
143
#if ENABLE(DEVICE_ORIENTATION)
144
#if ENABLE(DEVICE_ORIENTATION)
145
    , m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)
144
    , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
146
    , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
145
#endif
147
#endif
146
#if ENABLE(INPUT_SPEECH)
148
#if ENABLE(INPUT_SPEECH)
- a/WebCore/page/Page.h +6 lines
Lines 44-49 namespace WebCore { a/WebCore/page/Page.h_sec1
44
    class ChromeClient;
44
    class ChromeClient;
45
    class ContextMenuClient;
45
    class ContextMenuClient;
46
    class ContextMenuController;
46
    class ContextMenuController;
47
    class DeviceMotionClient;
48
    class DeviceMotionController;
47
    class DeviceOrientationClient;
49
    class DeviceOrientationClient;
48
    class DeviceOrientationController;
50
    class DeviceOrientationController;
49
    class Document;
51
    class Document;
Lines 101-106 namespace WebCore { a/WebCore/page/Page.h_sec2
101
                , inspectorClient(0)
103
                , inspectorClient(0)
102
                , pluginHalterClient(0)
104
                , pluginHalterClient(0)
103
                , geolocationControllerClient(0)
105
                , geolocationControllerClient(0)
106
                , deviceMotionClient(0)
104
                , deviceOrientationClient(0)
107
                , deviceOrientationClient(0)
105
                , backForwardControllerClient(0)
108
                , backForwardControllerClient(0)
106
                , speechInputClient(0)
109
                , speechInputClient(0)
Lines 113-118 namespace WebCore { a/WebCore/page/Page.h_sec3
113
            InspectorClient* inspectorClient;
116
            InspectorClient* inspectorClient;
114
            PluginHalterClient* pluginHalterClient;
117
            PluginHalterClient* pluginHalterClient;
115
            GeolocationControllerClient* geolocationControllerClient;
118
            GeolocationControllerClient* geolocationControllerClient;
119
            DeviceMotionClient* deviceMotionClient;
116
            DeviceOrientationClient* deviceOrientationClient;
120
            DeviceOrientationClient* deviceOrientationClient;
117
            BackForwardControllerClient* backForwardControllerClient;
121
            BackForwardControllerClient* backForwardControllerClient;
118
            SpeechInputClient* speechInputClient;
122
            SpeechInputClient* speechInputClient;
Lines 179-184 namespace WebCore { a/WebCore/page/Page.h_sec4
179
        GeolocationController* geolocationController() const { return m_geolocationController.get(); }
183
        GeolocationController* geolocationController() const { return m_geolocationController.get(); }
180
#endif
184
#endif
181
#if ENABLE(DEVICE_ORIENTATION)
185
#if ENABLE(DEVICE_ORIENTATION)
186
        DeviceMotionController* deviceMotionController() const { return m_deviceMotionController.get(); }
182
        DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
187
        DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
183
#endif
188
#endif
184
#if ENABLE(INPUT_SPEECH)
189
#if ENABLE(INPUT_SPEECH)
Lines 313-318 namespace WebCore { a/WebCore/page/Page.h_sec5
313
        OwnPtr<GeolocationController> m_geolocationController;
318
        OwnPtr<GeolocationController> m_geolocationController;
314
#endif
319
#endif
315
#if ENABLE(DEVICE_ORIENTATION)
320
#if ENABLE(DEVICE_ORIENTATION)
321
        OwnPtr<DeviceMotionController> m_deviceMotionController;
316
        OwnPtr<DeviceOrientationController> m_deviceOrientationController;
322
        OwnPtr<DeviceOrientationController> m_deviceOrientationController;
317
#endif
323
#endif
318
#if ENABLE(INPUT_SPEECH)
324
#if ENABLE(INPUT_SPEECH)

Return to Bug 42865