Title: [124759] trunk
Revision
124759
Author
commit-qu...@webkit.org
Date
2012-08-06 06:04:03 -0700 (Mon, 06 Aug 2012)

Log Message

Add DeviceProximityEvent interface
https://bugs.webkit.org/show_bug.cgi?id=92942

Patch by Kihong Kwon <kihong.k...@samsung.com> on 2012-08-06
Reviewed by Kentaro Hara.

Source/WebCore:

Spec : http://www.w3.org/TR/proximity/#idl-def-DeviceProximityEvent

Add DeviceProximityEvent interface of Proximity Events.
And add onwebkitdeviceproximity event handler to the DOMWindow.

Tests: fast/dom/Proximity/check-event-deviceproximity.html
       fast/dom/Proximity/create-event-deviceproximity.html
       fast/events/constructors/device-proximity-event-constructor.html

* CMakeLists.txt:
* Modules/proximity/DeviceProximityEvent.cpp: Added.
(WebCore):
(WebCore::DeviceProximityEvent::DeviceProximityEvent):
* Modules/proximity/DeviceProximityEvent.h: Added.
(WebCore):
(WebCore::DeviceProximityEventInit::DeviceProximityEventInit):
(DeviceProximityEventInit):
(DeviceProximityEvent):
(WebCore::DeviceProximityEvent::~DeviceProximityEvent):
(WebCore::DeviceProximityEvent::create):
(WebCore::DeviceProximityEvent::value):
(WebCore::DeviceProximityEvent::min):
(WebCore::DeviceProximityEvent::max):
(WebCore::DeviceProximityEvent::interfaceName):
* Modules/proximity/DeviceProximityEvent.idl: Added.
* dom/EventNames.h:
(WebCore):
* dom/EventNames.in:
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl:

LayoutTests:

Add tests for creating and handling the DeviceProximityEvent.

* fast/dom/Proximity/check-event-deviceproximity-expected.txt: Added.
* fast/dom/Proximity/check-event-deviceproximity.html: Added.
* fast/dom/Proximity/create-event-deviceproximity-expected.txt: Added.
* fast/dom/Proximity/create-event-deviceproximity.html: Added.
* fast/events/constructors/device-proximity-event-constructor-expected.txt: Added.
* fast/events/constructors/device-proximity-event-constructor.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/Skipped:
* platform/qt/Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (124758 => 124759)


--- trunk/LayoutTests/ChangeLog	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/ChangeLog	2012-08-06 13:04:03 UTC (rev 124759)
@@ -1,3 +1,24 @@
+2012-08-06  Kihong Kwon  <kihong.k...@samsung.com>
+
+        Add DeviceProximityEvent interface
+        https://bugs.webkit.org/show_bug.cgi?id=92942
+
+        Reviewed by Kentaro Hara.
+
+        Add tests for creating and handling the DeviceProximityEvent.
+
+        * fast/dom/Proximity/check-event-deviceproximity-expected.txt: Added.
+        * fast/dom/Proximity/check-event-deviceproximity.html: Added.
+        * fast/dom/Proximity/create-event-deviceproximity-expected.txt: Added.
+        * fast/dom/Proximity/create-event-deviceproximity.html: Added.
+        * fast/events/constructors/device-proximity-event-constructor-expected.txt: Added.
+        * fast/events/constructors/device-proximity-event-constructor.html: Added.
+        * platform/chromium/TestExpectations:
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+
 2012-08-06  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
 
         [EFL] EFL's LayoutTestController needs removeAllVisitedLinks implementation

Added: trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity-expected.txt (0 => 124759)


--- trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity-expected.txt	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,13 @@
+This test is for checking availablity of proximity event.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'onwebkitdeviceproximity' in window is true
+PASS document.createEvent('DeviceProximityEvent') instanceof window.DeviceProximityEvent is true
+PASS document.createEvent('DeviceProximityEvent') instanceof window.Event is true
+PASS document.createEvent('DeviceProximityEvent').constructor === window.DeviceProximityEvent is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity.html (0 => 124759)


--- trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Proximity/check-event-deviceproximity.html	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<div id="result"></div>
+<script>
+description("This test is for checking availablity of proximity event.");
+
+shouldBeTrue("'onwebkitdeviceproximity' in window");
+
+shouldBeTrue("document.createEvent('DeviceProximityEvent') instanceof window.DeviceProximityEvent");
+shouldBeTrue("document.createEvent('DeviceProximityEvent') instanceof window.Event");
+shouldBeTrue("document.createEvent('DeviceProximityEvent').constructor === window.DeviceProximityEvent");
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity-expected.txt (0 => 124759)


--- trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity-expected.txt	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,10 @@
+Tests that document.createEvent() works with deviceproximity
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS deviceproximity event is called properly.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity.html (0 => 124759)


--- trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/Proximity/create-event-deviceproximity.html	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="result"></div>
+<div id="console"></div>
+<script>
+description('Tests that document.createEvent() works with deviceproximity');
+
+function handleDeviceProximity()
+{
+    testPassed("deviceproximity event is called properly.");
+}
+
+window.addEventListener('webkitdeviceproximity', handleDeviceProximity, false);
+
+try {
+    var event = document.createEvent("DeviceProximityEvent");
+    event.initEvent("webkitdeviceproximity", false, false);
+    window.dispatchEvent(event);
+} catch(e) {
+    testFailed("deviceproximity event doesn't appear to be enabled or implemented.");
+}
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor-expected.txt (0 => 124759)


--- trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor-expected.txt	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,83 @@
+This tests the constructor for the DeviceProximityEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new DeviceProximityEvent('eventType').bubbles is true
+PASS new DeviceProximityEvent('eventType').cancelable is false
+PASS new DeviceProximityEvent('eventType').value is Infinity
+PASS new DeviceProximityEvent('eventType').min is -Infinity
+PASS new DeviceProximityEvent('eventType').max is Infinity
+PASS new DeviceProximityEvent('eventType', { bubbles: false }).bubbles is false
+PASS new DeviceProximityEvent('eventType', { bubbles: true }).bubbles is true
+PASS new DeviceProximityEvent('eventType', { cancelable: false }).cancelable is false
+PASS new DeviceProximityEvent('eventType', { cancelable: true }).cancelable is true
+PASS new DeviceProximityEvent('eventType', { value: 0 }).value is 0
+PASS new DeviceProximityEvent('eventType', { value: 1 }).value is 1
+PASS new DeviceProximityEvent('eventType', { value: 1.79769313486231570E+308 }).value is 1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { value: -1.79769313486231570E+308 }).value is -1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { value: 1.8E+308 }).value is Infinity
+PASS new DeviceProximityEvent('eventType', { value: -1.8E+308 }).value is -Infinity
+PASS new DeviceProximityEvent('eventType', { value: 123.45 }).value is 123.45
+PASS new DeviceProximityEvent('eventType', { value: NaN }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: undefined }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: null }).value is 0
+PASS new DeviceProximityEvent('eventType', { value: '' }).value is 0
+PASS new DeviceProximityEvent('eventType', { value: '12345' }).value is 12345
+PASS new DeviceProximityEvent('eventType', { value: '12345a' }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: 'abc' }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: [] }).value is 0
+PASS new DeviceProximityEvent('eventType', { value: [12345] }).value is 12345
+PASS new DeviceProximityEvent('eventType', { value: [12345, 67890] }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: {} }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: {moemoe: 12345} }).value is NaN
+PASS new DeviceProximityEvent('eventType', { value: {valueOf: function () { return 12345; }} }).value is 12345
+PASS new DeviceProximityEvent('eventType', { min: 0 }).min is 0
+PASS new DeviceProximityEvent('eventType', { min: 1 }).min is 1
+PASS new DeviceProximityEvent('eventType', { min: 1.79769313486231570E+308 }).min is 1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { min: -1.79769313486231570E+308 }).min is -1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { min: 1.8E+308 }).min is Infinity
+PASS new DeviceProximityEvent('eventType', { min: -1.8E+308 }).min is -Infinity
+PASS new DeviceProximityEvent('eventType', { min: 123.45 }).min is 123.45
+PASS new DeviceProximityEvent('eventType', { min: NaN }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: undefined }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: null }).min is 0
+PASS new DeviceProximityEvent('eventType', { min: '' }).min is 0
+PASS new DeviceProximityEvent('eventType', { min: '12345' }).min is 12345
+PASS new DeviceProximityEvent('eventType', { min: '12345a' }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: 'abc' }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: [] }).min is 0
+PASS new DeviceProximityEvent('eventType', { min: [12345] }).min is 12345
+PASS new DeviceProximityEvent('eventType', { min: [12345, 67890] }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: {} }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: {moemoe: 12345} }).min is NaN
+PASS new DeviceProximityEvent('eventType', { min: {valueOf: function () { return 12345; }} }).min is 12345
+PASS new DeviceProximityEvent('eventType', { max: 0 }).max is 0
+PASS new DeviceProximityEvent('eventType', { max: 1 }).max is 1
+PASS new DeviceProximityEvent('eventType', { max: 1.79769313486231570E+308 }).max is 1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { max: -1.79769313486231570E+308 }).max is -1.79769313486231570E+308
+PASS new DeviceProximityEvent('eventType', { max: 1.8E+308 }).max is Infinity
+PASS new DeviceProximityEvent('eventType', { max: -1.8E+308 }).max is -Infinity
+PASS new DeviceProximityEvent('eventType', { max: 123.45 }).max is 123.45
+PASS new DeviceProximityEvent('eventType', { max: NaN }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: undefined }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: null }).max is 0
+PASS new DeviceProximityEvent('eventType', { max: '' }).max is 0
+PASS new DeviceProximityEvent('eventType', { max: '12345' }).max is 12345
+PASS new DeviceProximityEvent('eventType', { max: '12345a' }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: 'abc' }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: [] }).max is 0
+PASS new DeviceProximityEvent('eventType', { max: [12345] }).max is 12345
+PASS new DeviceProximityEvent('eventType', { max: [12345, 67890] }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: {} }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: {moemoe: 12345} }).max is NaN
+PASS new DeviceProximityEvent('eventType', { max: {valueOf: function () { return 12345; }} }).max is 12345
+PASS new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).bubbles is true
+PASS new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).cancelable is true
+PASS new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).value is 1000
+PASS new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).min is 0
+PASS new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).max is 10000
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor.html (0 => 124759)


--- trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/device-proximity-event-constructor.html	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests the constructor for the DeviceProximityEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new DeviceProximityEvent('eventType').bubbles", "true");
+shouldBe("new DeviceProximityEvent('eventType').cancelable", "false");
+shouldBe("new DeviceProximityEvent('eventType').value", "Infinity");
+shouldBe("new DeviceProximityEvent('eventType').min", "-Infinity");
+shouldBe("new DeviceProximityEvent('eventType').max", "Infinity");
+
+// bubbles is passed.
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new DeviceProximityEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new DeviceProximityEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// value is passed.
+// Numbers within the double range.
+shouldBe("new DeviceProximityEvent('eventType', { value: 0 }).value", "0");
+shouldBe("new DeviceProximityEvent('eventType', { value: 1 }).value", "1");
+shouldBe("new DeviceProximityEvent('eventType', { value: 1.79769313486231570E+308 }).value", "1.79769313486231570E+308");
+shouldBe("new DeviceProximityEvent('eventType', { value: -1.79769313486231570E+308 }).value", "-1.79769313486231570E+308");
+
+// Numbers out of the double range.
+shouldBe("new DeviceProximityEvent('eventType', { value: 1.8E+308 }).value", "Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { value: -1.8E+308 }).value", "-Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { value: 123.45 }).value", "123.45");
+shouldBe("new DeviceProximityEvent('eventType', { value: NaN }).value", "NaN");
+
+// Non-numeric values.
+shouldBe("new DeviceProximityEvent('eventType', { value: undefined }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: null }).value", "0");
+shouldBe("new DeviceProximityEvent('eventType', { value: '' }).value", "0");
+shouldBe("new DeviceProximityEvent('eventType', { value: '12345' }).value", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { value: '12345a' }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: 'abc' }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: [] }).value", "0");
+shouldBe("new DeviceProximityEvent('eventType', { value: [12345] }).value", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { value: [12345, 67890] }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: {} }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: {moemoe: 12345} }).value", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { value: {valueOf: function () { return 12345; }} }).value", "12345");
+
+// min is passed.
+// Numbers within the double range.
+shouldBe("new DeviceProximityEvent('eventType', { min: 0 }).min", "0");
+shouldBe("new DeviceProximityEvent('eventType', { min: 1 }).min", "1");
+shouldBe("new DeviceProximityEvent('eventType', { min: 1.79769313486231570E+308 }).min", "1.79769313486231570E+308");
+shouldBe("new DeviceProximityEvent('eventType', { min: -1.79769313486231570E+308 }).min", "-1.79769313486231570E+308");
+
+// Numbers out of the double range.
+shouldBe("new DeviceProximityEvent('eventType', { min: 1.8E+308 }).min", "Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { min: -1.8E+308 }).min", "-Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { min: 123.45 }).min", "123.45");
+shouldBe("new DeviceProximityEvent('eventType', { min: NaN }).min", "NaN");
+
+// Non-numeric mins.
+shouldBe("new DeviceProximityEvent('eventType', { min: undefined }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: null }).min", "0");
+shouldBe("new DeviceProximityEvent('eventType', { min: '' }).min", "0");
+shouldBe("new DeviceProximityEvent('eventType', { min: '12345' }).min", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { min: '12345a' }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: 'abc' }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: [] }).min", "0");
+shouldBe("new DeviceProximityEvent('eventType', { min: [12345] }).min", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { min: [12345, 67890] }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: {} }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: {moemoe: 12345} }).min", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { min: {valueOf: function () { return 12345; }} }).min", "12345");
+
+// max is passed.
+// Numbers within the double range.
+shouldBe("new DeviceProximityEvent('eventType', { max: 0 }).max", "0");
+shouldBe("new DeviceProximityEvent('eventType', { max: 1 }).max", "1");
+shouldBe("new DeviceProximityEvent('eventType', { max: 1.79769313486231570E+308 }).max", "1.79769313486231570E+308");
+shouldBe("new DeviceProximityEvent('eventType', { max: -1.79769313486231570E+308 }).max", "-1.79769313486231570E+308");
+
+// Numbers out of the double range.
+shouldBe("new DeviceProximityEvent('eventType', { max: 1.8E+308 }).max", "Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { max: -1.8E+308 }).max", "-Infinity");
+shouldBe("new DeviceProximityEvent('eventType', { max: 123.45 }).max", "123.45");
+shouldBe("new DeviceProximityEvent('eventType', { max: NaN }).max", "NaN");
+
+// Non-numeric maxs.
+shouldBe("new DeviceProximityEvent('eventType', { max: undefined }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: null }).max", "0");
+shouldBe("new DeviceProximityEvent('eventType', { max: '' }).max", "0");
+shouldBe("new DeviceProximityEvent('eventType', { max: '12345' }).max", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { max: '12345a' }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: 'abc' }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: [] }).max", "0");
+shouldBe("new DeviceProximityEvent('eventType', { max: [12345] }).max", "12345");
+shouldBe("new DeviceProximityEvent('eventType', { max: [12345, 67890] }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: {} }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: {moemoe: 12345} }).max", "NaN");
+shouldBe("new DeviceProximityEvent('eventType', { max: {valueOf: function () { return 12345; }} }).max", "12345");
+
+// All initializers are passed.
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).bubbles", "true");
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).cancelable", "true");
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).value", "1000");
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).min", "0");
+shouldBe("new DeviceProximityEvent('eventType', { bubbles: true, cancelable: true, value: 1000, min: 0, max: 10000 }).max", "10000");
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (124758 => 124759)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-06 13:04:03 UTC (rev 124759)
@@ -153,6 +153,10 @@
 // Chromium needs larger media files to test buffering this way.
 BUGWK88172 SKIP : http/tests/media/video-buffered.html = PASS
 
+// Proximity Events is not supported.
+BUGWK92942 SKIP : fast/dom/Proximity = PASS
+BUGWK92942 SKIP : fast/events/constructors/device-proximity-event-constructor.html = PASS
+
 // -----------------------------------------------------------------
 // WONTFIX TESTS
 // -----------------------------------------------------------------

Modified: trunk/LayoutTests/platform/efl/TestExpectations (124758 => 124759)


--- trunk/LayoutTests/platform/efl/TestExpectations	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2012-08-06 13:04:03 UTC (rev 124759)
@@ -823,6 +823,10 @@
 // This test depends on subpixel layout.
 BUGWK92352 : css3/flexbox/flex-rounding.html = TEXT
 
+// Proximity Events is not supported.
+BUGWK92942 SKIP : fast/dom/Proximity = PASS
+BUGWK92942 SKIP : fast/events/constructors/device-proximity-event-constructor.html = PASS
+
 // Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=80219
 BUGWK80219 : fast/box-sizing/box-sizing.html = IMAGE+TEXT
 BUGWK80219 : compositing/overflow/clip-descendents.html = TEXT

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (124758 => 124759)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-06 13:04:03 UTC (rev 124759)
@@ -393,6 +393,11 @@
 
 // Dialog element is not yet enabled.
 BUGWK84635 SKIP : fast/dom/HTMLDialogElement = TEXT
+
+// Proximity Events is not supported.
+BUGWK92942 SKIP : fast/dom/Proximity = PASS
+BUGWK92942 SKIP : fast/events/constructors/device-proximity-event-constructor.html = PASS
+
 //////////////////////////////////////////////////////////////////////////////////////////
 // End of Expected failures
 //////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/LayoutTests/platform/mac/Skipped (124758 => 124759)


--- trunk/LayoutTests/platform/mac/Skipped	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/platform/mac/Skipped	2012-08-06 13:04:03 UTC (rev 124759)
@@ -616,6 +616,10 @@
 #Network Information is not supported yet. http://webkit.org/b/73528
 networkinformation
 
+# Proximity Events is not supported.
+fast/dom/Proximity
+fast/events/constructors/device-proximity-event-constructor.html
+
 # https://bugs.webkit.org/show_bug.cgi?id=43022
 tables/mozilla_expected_failures/bugs/bug85016.html
 

Modified: trunk/LayoutTests/platform/qt/Skipped (124758 => 124759)


--- trunk/LayoutTests/platform/qt/Skipped	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-08-06 13:04:03 UTC (rev 124759)
@@ -495,6 +495,10 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85558
 http/tests/security/contentSecurityPolicy/1.1
 
+# Proximity Events is now supported.
+fast/dom/Proximity
+fast/events/constructors/device-proximity-event-constructor.html
+
 # =========================================================================== #
 #       Drag and Drop Support in DRT.                                         #
 # =========================================================================== #

Modified: trunk/Source/WebCore/CMakeLists.txt (124758 => 124759)


--- trunk/Source/WebCore/CMakeLists.txt	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-08-06 13:04:03 UTC (rev 124759)
@@ -11,6 +11,7 @@
     "${WEBCORE_DIR}/Modules/networkinfo"
     "${WEBCORE_DIR}/Modules/notifications"
     "${WEBCORE_DIR}/Modules/protocolhandler"
+    "${WEBCORE_DIR}/Modules/proximity"
     "${WEBCORE_DIR}/Modules/quota"
     "${WEBCORE_DIR}/Modules/vibration"
     "${WEBCORE_DIR}/Modules/webaudio"
@@ -224,7 +225,9 @@
     Modules/notifications/WorkerContextNotifications.idl
 
     Modules/protocolhandler/NavigatorRegisterProtocolHandler.idl
-    
+
+    Modules/proximity/DeviceProximityEvent.idl
+
     Modules/quota/DOMWindowQuota.idl
     Modules/quota/StorageInfo.idl
     Modules/quota/StorageInfoErrorCallback.idl
@@ -853,6 +856,8 @@
 
     Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp
 
+    Modules/proximity/DeviceProximityEvent.cpp
+
     Modules/quota/DOMWindowQuota.cpp
     Modules/quota/StorageInfo.cpp
 

Modified: trunk/Source/WebCore/ChangeLog (124758 => 124759)


--- trunk/Source/WebCore/ChangeLog	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/ChangeLog	2012-08-06 13:04:03 UTC (rev 124759)
@@ -1,3 +1,42 @@
+2012-08-06  Kihong Kwon  <kihong.k...@samsung.com>
+
+        Add DeviceProximityEvent interface
+        https://bugs.webkit.org/show_bug.cgi?id=92942
+
+        Reviewed by Kentaro Hara.
+
+        Spec : http://www.w3.org/TR/proximity/#idl-def-DeviceProximityEvent
+
+        Add DeviceProximityEvent interface of Proximity Events.
+        And add onwebkitdeviceproximity event handler to the DOMWindow.
+
+        Tests: fast/dom/Proximity/check-event-deviceproximity.html
+               fast/dom/Proximity/create-event-deviceproximity.html
+               fast/events/constructors/device-proximity-event-constructor.html
+
+        * CMakeLists.txt:
+        * Modules/proximity/DeviceProximityEvent.cpp: Added.
+        (WebCore):
+        (WebCore::DeviceProximityEvent::DeviceProximityEvent):
+        * Modules/proximity/DeviceProximityEvent.h: Added.
+        (WebCore):
+        (WebCore::DeviceProximityEventInit::DeviceProximityEventInit):
+        (DeviceProximityEventInit):
+        (DeviceProximityEvent):
+        (WebCore::DeviceProximityEvent::~DeviceProximityEvent):
+        (WebCore::DeviceProximityEvent::create):
+        (WebCore::DeviceProximityEvent::value):
+        (WebCore::DeviceProximityEvent::min):
+        (WebCore::DeviceProximityEvent::max):
+        (WebCore::DeviceProximityEvent::interfaceName):
+        * Modules/proximity/DeviceProximityEvent.idl: Added.
+        * dom/EventNames.h:
+        (WebCore):
+        * dom/EventNames.in:
+        * page/DOMWindow.h:
+        (DOMWindow):
+        * page/DOMWindow.idl:
+
 2012-08-06  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Fix make distcheck.

Added: trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.cpp (0 => 124759)


--- trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.cpp	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,54 @@
+/*
+ *  Copyright (C) 2012 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "DeviceProximityEvent.h"
+
+#if ENABLE(PROXIMITY_EVENTS)
+
+#include <limits>
+
+namespace WebCore {
+
+DeviceProximityEvent::DeviceProximityEvent()
+    : m_value(std::numeric_limits<double>::infinity())
+    , m_min(-std::numeric_limits<double>::infinity())
+    , m_max(std::numeric_limits<double>::infinity())
+{
+}
+
+DeviceProximityEvent::DeviceProximityEvent(const AtomicString& eventType, const double value, const double min, const double max)
+    : Event(eventType, true, false) // Default event is bubbles, not cancelable.
+    , m_value(value)
+    , m_min(min)
+    , m_max(max)
+{
+}
+
+DeviceProximityEvent::DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit& initializer)
+    : Event(eventType, initializer)
+    , m_value(initializer.value)
+    , m_min(initializer.min)
+    , m_max(initializer.max)
+{
+}
+
+} // namespace WebCore
+
+#endif // PROXIMITY_EVENTS

Added: trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.h (0 => 124759)


--- trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.h	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,83 @@
+/*
+ *  Copyright (C) 2012 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef DeviceProximityEvent_h
+#define DeviceProximityEvent_h
+
+#if ENABLE(PROXIMITY_EVENTS)
+
+#include "Event.h"
+
+namespace WebCore {
+
+struct DeviceProximityEventInit : public EventInit {
+    DeviceProximityEventInit()
+        : value(std::numeric_limits<double>::infinity())
+        , min(-std::numeric_limits<double>::infinity())
+        , max(std::numeric_limits<double>::infinity())
+    {
+        // Default value of bubbles is true by the Proximity Events spec.
+        // http://www.w3.org/TR/proximity/#deviceproximityevent-interface
+        bubbles = true;
+    };
+
+    double value;
+    double min;
+    double max;
+};
+
+class DeviceProximityEvent : public Event {
+public:
+    ~DeviceProximityEvent() { }
+
+    static PassRefPtr<DeviceProximityEvent> create()
+    {
+        return adoptRef(new DeviceProximityEvent());
+    }
+
+    static PassRefPtr<DeviceProximityEvent> create(const AtomicString& eventType, const double value, const double min, const double max)
+    {
+        return adoptRef(new DeviceProximityEvent(eventType, value, min, max));
+    }
+
+    static PassRefPtr<DeviceProximityEvent> create(const AtomicString& type, const DeviceProximityEventInit& initializer)
+    {
+        return adoptRef(new DeviceProximityEvent(type, initializer));
+    }
+
+    double value() { return m_value; }
+    double min() { return m_min; }
+    double max() { return m_max; }
+
+    virtual const AtomicString& interfaceName() const { return eventNames().interfaceForDeviceProximityEvent; }
+
+private:
+    DeviceProximityEvent();
+    DeviceProximityEvent(const AtomicString& eventType, const double value, const double min, const double max);
+    DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit&);
+
+    double m_value;
+    double m_min;
+    double m_max;
+};
+
+} // namespace WebCore
+
+#endif // DeviceProximityEvent_h
+#endif // PROXIMITY_EVENTS

Added: trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.idl (0 => 124759)


--- trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.idl	2012-08-06 13:04:03 UTC (rev 124759)
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (C) 2012 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+module core {
+
+    interface [
+        Conditional=PROXIMITY_EVENTS,
+        ConstructorTemplate=Event
+    ] DeviceProximityEvent : Event {
+        readonly attribute [InitializedByEventConstructor] double value;
+        readonly attribute [InitializedByEventConstructor] double min;
+        readonly attribute [InitializedByEventConstructor] double max;
+    };
+
+}

Modified: trunk/Source/WebCore/dom/EventNames.h (124758 => 124759)


--- trunk/Source/WebCore/dom/EventNames.h	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/dom/EventNames.h	2012-08-06 13:04:03 UTC (rev 124759)
@@ -238,6 +238,8 @@
     \
     macro(webkitresourcetimingbufferfull) \
     \
+    macro(webkitdeviceproximity) \
+    \
 
 // end of DOM_EVENT_NAMES_FOR_EACH
 

Modified: trunk/Source/WebCore/dom/EventNames.in (124758 => 124759)


--- trunk/Source/WebCore/dom/EventNames.in	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/dom/EventNames.in	2012-08-06 13:04:03 UTC (rev 124759)
@@ -43,6 +43,7 @@
 TouchEvent conditional=TOUCH_EVENTS, runtimeConditional=touchEnabled
 DeviceMotionEvent conditional=DEVICE_ORIENTATION
 DeviceOrientationEvent conditional=DEVICE_ORIENTATION
+DeviceProximityEvent conditional=PROXIMITY_EVENTS
 OrientationEvent interfaceName=Event, conditional=ORIENTATION_EVENTS
 MediaKeyEvent conditional=ENCRYPTED_MEDIA
 TrackEvent conditional=VIDEO_TRACK

Modified: trunk/Source/WebCore/page/DOMWindow.h (124758 => 124759)


--- trunk/Source/WebCore/page/DOMWindow.h	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/page/DOMWindow.h	2012-08-06 13:04:03 UTC (rev 124759)
@@ -353,6 +353,10 @@
         DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
 #endif
 
+#if ENABLE(PROXIMITY_EVENTS)
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitdeviceproximity);
+#endif
+
         // HTML 5 key/value storage
         Storage* sessionStorage(ExceptionCode&) const;
         Storage* localStorage(ExceptionCode&) const;

Modified: trunk/Source/WebCore/page/DOMWindow.idl (124758 => 124759)


--- trunk/Source/WebCore/page/DOMWindow.idl	2012-08-06 13:03:42 UTC (rev 124758)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2012-08-06 13:04:03 UTC (rev 124759)
@@ -313,6 +313,8 @@
         attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondevicemotion;
         attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondeviceorientation;
 
+        attribute [Conditional=PROXIMITY_EVENTS] EventListener onwebkitdeviceproximity;
+
         // EventTarget interface
         [Custom] void addEventListener(in DOMString type,
                                       in EventListener listener,
@@ -551,6 +553,7 @@
         attribute StorageEventConstructor StorageEvent;
         attribute [Conditional=INPUT_SPEECH] SpeechInputEventConstructor SpeechInputEvent;
         attribute [Conditional=WEBGL] WebGLContextEventConstructor WebGLContextEvent;
+        attribute [Conditional=PROXIMITY_EVENTS] DeviceProximityEventConstructor DeviceProximityEvent;
 
         attribute EventExceptionConstructor EventException;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to