Commit 2f4e6fc9 authored by steveblock@google.com's avatar steveblock@google.com

2010-05-20 Steve Block <steveblock@google.com>

        Reviewed by Jeremy Orlow.

        Provide bindings for DeviceOrientation
        https://bugs.webkit.org/show_bug.cgi?id=39210

        Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.

        * Configurations/FeatureDefines.xcconfig:
2010-05-20  Steve Block  <steveblock@google.com>

        Reviewed by Jeremy Orlow.

        Provide bindings for DeviceOrientation
        https://bugs.webkit.org/show_bug.cgi?id=39210

        Adds ENABLE_DEVICE_ORIENTATION to VisualStudio project files, always disabled.

        * win/tools/vsprops/FeatureDefines.vsprops:
        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
2010-05-20  Steve Block  <steveblock@google.com>

        Reviewed by Jeremy Orlow.

        Provide bindings for DeviceOrientation
        https://bugs.webkit.org/show_bug.cgi?id=39210

        Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.

        * Configurations/FeatureDefines.xcconfig:
2010-05-20  Steve Block  <steveblock@google.com>

        Reviewed by Jeremy Orlow.

        Provide bindings for DeviceOrientation
        https://bugs.webkit.org/show_bug.cgi?id=39210

        Tests: fast/dom/DeviceOrientation/window-property.html
               fast/dom/Window/window-properties-on-device-orientation.html

        Adds bindings for DeviceOrientation as defined in
        http://dev.w3.org/geo/api/spec-source-orientation.html
        This is guarded by ENABLE(DEVICE_ORIENTATION) which is currently disabled on
        all platforms but Android.

        * Android.derived.jscbindings.mk:
        * Android.derived.v8bindings.mk:
        * Android.mk:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pri:
        * WebCore.pro:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJS):
        * bindings/v8/custom/V8EventCustom.cpp:
        (WebCore::toV8):
        * dom/DeviceOrientationEvent.cpp: Added.
        (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
        (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
        * dom/DeviceOrientationEvent.h: Added.
        (WebCore::DeviceOrientationEvent::create):
        (WebCore::DeviceOrientationEvent::alpha):
        (WebCore::DeviceOrientationEvent::beta):
        (WebCore::DeviceOrientationEvent::gamma):
        (WebCore::DeviceOrientationEvent::isDeviceOrientationEvent):
        * dom/DeviceOrientationEvent.idl: Added.
        * dom/Event.cpp:
        (WebCore::Event::isDeviceOrientationEvent):
        * dom/Event.h:
        * dom/EventNames.h:
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
2010-05-20  Steve Block  <steveblock@google.com>

        Reviewed by Jeremy Orlow.

        Provide bindings for DeviceOrientation
        https://bugs.webkit.org/show_bug.cgi?id=39210

        Modifies existing fast/dom/Window tests to skip window.ondeviceorientation until
        it is widely supported.
        Adds new fast/dom/Window/window-properties-on-device-orientation.html to test
        type and presence of window.ondeviceorientation.
        Adds new fast/dom/DeviceOrientation directory and initial test.
        Adds all DeviceOrientation tests to all skipped lists.

        * fast/dom/DeviceOrientation: Added.
        * fast/dom/DeviceOrientation/script-tests: Added.
        * fast/dom/DeviceOrientation/script-tests/TEMPLATE.html: Added.
        * fast/dom/DeviceOrientation/script-tests/window-property.js: Added.
        (hasOnDeviceOrientationProperty):
        * fast/dom/DeviceOrientation/window-property-expected.txt: Added.
        * fast/dom/DeviceOrientation/window-property.html: Added.
        * fast/dom/Window/script-tests/window-property-descriptors.js:
        * fast/dom/Window/window-properties-on-device-orientation-expected.txt: Added.
        * fast/dom/Window/window-properties-on-device-orientation.html: Added.
        * fast/dom/Window/window-properties.html:
        * platform/chromium/test_expectations.txt:
        * platform/gtk/Skipped:
        * platform/mac/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fb767332
2010-05-20 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
Provide bindings for DeviceOrientation
https://bugs.webkit.org/show_bug.cgi?id=39210
Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.
* Configurations/FeatureDefines.xcconfig:
2010-05-19 Gavin Barraclough <barraclough@apple.com>
Reviewed by Geoff Garen.
......
......@@ -47,6 +47,7 @@ ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
ENABLE_DATABASE = ENABLE_DATABASE;
ENABLE_DATAGRID = ;
ENABLE_DATALIST = ENABLE_DATALIST;
ENABLE_DEVICE_ORIENTATION = ;
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
......@@ -78,4 +79,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
2010-05-20 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
Provide bindings for DeviceOrientation
https://bugs.webkit.org/show_bug.cgi?id=39210
Modifies existing fast/dom/Window tests to skip window.ondeviceorientation until
it is widely supported.
Adds new fast/dom/Window/window-properties-on-device-orientation.html to test
type and presence of window.ondeviceorientation.
Adds new fast/dom/DeviceOrientation directory and initial test.
Adds all DeviceOrientation tests to all skipped lists.
* fast/dom/DeviceOrientation: Added.
* fast/dom/DeviceOrientation/script-tests: Added.
* fast/dom/DeviceOrientation/script-tests/TEMPLATE.html: Added.
* fast/dom/DeviceOrientation/script-tests/window-property.js: Added.
(hasOnDeviceOrientationProperty):
* fast/dom/DeviceOrientation/window-property-expected.txt: Added.
* fast/dom/DeviceOrientation/window-property.html: Added.
* fast/dom/Window/script-tests/window-property-descriptors.js:
* fast/dom/Window/window-properties-on-device-orientation-expected.txt: Added.
* fast/dom/Window/window-properties-on-device-orientation.html: Added.
* fast/dom/Window/window-properties.html:
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
2010-05-20 Martin Robinson <mrobinson@webkit.org>
Reviewed by Ojan Vafai.
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="YOUR_JS_FILE_HERE"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
description("Tests that the window.ondeviceorientation property is present.");
function hasOnDeviceOrientationProperty()
{
for (var property in window) {
if (property == "ondeviceorientation")
return true;
}
return false;
}
shouldBeTrue("typeof window.ondeviceorientation == 'object'");
shouldBeTrue("hasOnDeviceOrientationProperty()");
shouldBeTrue("'ondeviceorientation' in window");
shouldBeTrue("window.hasOwnProperty('ondeviceorientation')");
window.successfullyParsed = true;
Tests that the window.ondeviceorientation property is present.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS typeof window.ondeviceorientation == 'object' is true
PASS hasOnDeviceOrientationProperty() is true
PASS 'ondeviceorientation' in window is true
PASS window.hasOwnProperty('ondeviceorientation') is true
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script src="script-tests/window-property.js"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
......@@ -37,6 +37,7 @@ var __skip__ = {
"FloatArray" : 1,
"FileError" : 1,
"FileReader" : 1,
"ondeviceorientation" : 1,
// Ignore this property because it only appears in debug builds and not in release.
"jscprint" : 1
};
......
This test dumps all of the properties that are reachable from the window.ondeviceorientation object, along with their types.
window.ondeviceorientation [null]
<p>This test dumps all of the properties that are reachable from the window.ondeviceorientation
object, along with their types.</p>
<hr>
<pre id="pre"></pre>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
var logBuffer = [];
function log(s)
{
logBuffer.push(s);
}
var pre = document.getElementById('pre');
function flushLog()
{
var logMessage = logBuffer.join("");
pre.appendChild(document.createTextNode(logMessage));
}
function tryEval(string)
{
try {
return eval(string);
} catch (e) {
return new String("Caught exception: " + e);
}
}
function typeOfNullAware(value)
{
if (typeof value == "object" && value == null) //;
return "null";
return typeof value;
}
function typeStringNullAware(value)
{
var valueType = typeOfNullAware(value);
return valueType == "object"
? Object.prototype.toString.call(value)
: "[" + valueType + "]";
}
function logValue(valueName)
{
var value = tryEval(valueName);
var valueType = typeOfNullAware(value);
// Don't taint the test with our own variables
if (value == logBuffer || value == pre)
return;
// Don't taint the test with our own properties
if (/__visitedByLogValue__/.test(valueName) || /__nameWhenVisitedByLogValue__/.test(valueName))
return;
// Work around Firefox infinite recursion
if (/\.[0-9]/.test(valueName))
return;
// Avoid infinite recursion
if (valueType == "object" && value.__visitedByLogValue__) { //;
log(valueName + " [printed above as " + value.__nameWhenVisitedByLogValue__ + "]\n");
return;
}
log(valueName + " " + typeStringNullAware(value) + "\n");
if (valueType == "object") {
value.__visitedByLogValue__ = true;
value.__nameWhenVisitedByLogValue__ = valueName;
logProperties(value, valueName);
}
}
function logProperties(object, objectName)
{
var array = new Array;
for (var property in object) {
array.push(property);
}
array.sort();
for (var i = 0; i < array.length; i++) {
var property = array[i];
logValue(objectName + "." + property);
}
}
logValue('window.ondeviceorientation');
flushLog();
</script>
......@@ -82,7 +82,8 @@ var __skip__ = {
"window.clientInformation.geolocation" : 1,
"window.Blob.prototype.slice" : 1,
"window.FileError" : 1,
"window.FileReader" : 1
"window.FileReader" : 1,
"window.ondeviceorientation" : 1
};
function logValue(valueName)
......
......@@ -2838,3 +2838,7 @@ BUGWK39105 WIN LINUX : editing/spelling/context-menu-suggestions.html = MISSING
// Flaky tests
BUG44229 WIN LINUX : fast/loader/recursive-before-unload-crash.html = PASS TEXT
// DeviceOrientation API not yet implemented.
BUG44654 SKIP : fast/dom/DeviceOrientation = TEXT
BUG44654 SKIP : fast/dom/Window/window-properties-on-device-orientation.html = TEXT
......@@ -1179,6 +1179,7 @@ fast/dom/client-width-height-quirks.html
fast/dom/client-width-height.html
fast/dom/cssTarget-crash.html
fast/dom/frame-loading-via-document-write.html
fast/dom/DeviceOrientation/window-property.html
fast/dom/Geolocation/callback-exception.html
fast/dom/Geolocation/error.html
fast/dom/Geolocation/permission-denied-already-clear-watch.html
......@@ -1204,6 +1205,7 @@ fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml
fast/dom/Window/new-window-opener.html
fast/dom/Window/webkitConvertPoint.html
fast/dom/Window/window-onFocus.html
fast/dom/Window/window-properties-on-device-orientation.html
fast/dom/Window/window-resize-and-move-arguments.html
fast/dom/Window/window-resize.html
fast/dom/Window/window-xy-properties.html
......
......@@ -188,3 +188,7 @@ scrollbars/scrollbar-click-does-not-blur-content.html
# IndexedDB is not yet enabled.
storage/indexeddb
# This port doesn't support DeviceOrientation.
fast/dom/DeviceOrientation
fast/dom/Window/window-properties-on-device-orientation.html
......@@ -5088,3 +5088,7 @@ editing/spelling/context-menu-suggestions.html
# IndexedDB is not yet enabled.
storage/indexeddb
# This port doesn't support DeviceOrientation.
fast/dom/DeviceOrientation
fast/dom/Window/window-properties-on-device-orientation.html
......@@ -883,3 +883,7 @@ editing/spelling/context-menu-suggestions.html
# IndexedDB is not yet enabled.
storage/indexeddb
# This port doesn't support DeviceOrientation.
fast/dom/DeviceOrientation
fast/dom/Window/window-properties-on-device-orientation.html
......@@ -49,7 +49,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\
bindings/scripts/generate-bindings.pl \
)
FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1 ENABLE_CHANNEL_MESSAGING=1
FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1 ENABLE_CHANNEL_MESSAGING=1 ENABLE_DEVICE_ORIENTATION=1
# CSS
GEN := \
......@@ -103,6 +103,7 @@ GEN := \
$(intermediates)/dom/JSComment.h \
$(intermediates)/dom/JSDOMCoreException.h \
$(intermediates)/dom/JSDOMImplementation.h \
$(intermediates)/dom/JSDeviceOrientationEvent.h \
$(intermediates)/dom/JSDocument.h \
$(intermediates)/dom/JSDocumentFragment.h \
$(intermediates)/dom/JSDocumentType.h \
......
......@@ -30,7 +30,8 @@ js_binding_scripts := \
$(LOCAL_PATH)/bindings/scripts/IDLStructure.pm \
$(LOCAL_PATH)/bindings/scripts/generate-bindings.pl
FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1
FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1 ENABLE_DEVICE_ORIENTATION=1
FEATURE_DEFINES += V8_BINDING
# CSS
GEN := \
......@@ -84,6 +85,7 @@ GEN := \
$(intermediates)/bindings/V8Comment.h \
$(intermediates)/bindings/V8DOMCoreException.h \
$(intermediates)/bindings/V8DOMImplementation.h \
$(intermediates)/bindings/V8DeviceOrientationEvent.h \
$(intermediates)/bindings/V8Document.h \
$(intermediates)/bindings/V8DocumentFragment.h \
$(intermediates)/bindings/V8DocumentType.h \
......
......@@ -145,6 +145,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
dom/Notation.cpp \
dom/OptionElement.cpp \
dom/OptionGroupElement.cpp \
dom/DeviceOrientationEvent.cpp \
dom/OverflowEvent.cpp \
dom/PageTransitionEvent.cpp \
dom/Position.cpp \
......
2010-05-20 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
Provide bindings for DeviceOrientation
https://bugs.webkit.org/show_bug.cgi?id=39210
Tests: fast/dom/DeviceOrientation/window-property.html
fast/dom/Window/window-properties-on-device-orientation.html
Adds bindings for DeviceOrientation as defined in
http://dev.w3.org/geo/api/spec-source-orientation.html
This is guarded by ENABLE(DEVICE_ORIENTATION) which is currently disabled on
all platforms but Android.
* Android.derived.jscbindings.mk:
* Android.derived.v8bindings.mk:
* Android.mk:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp:
(WebCore::toJS):
* bindings/v8/custom/V8EventCustom.cpp:
(WebCore::toV8):
* dom/DeviceOrientationEvent.cpp: Added.
(WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
(WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
* dom/DeviceOrientationEvent.h: Added.
(WebCore::DeviceOrientationEvent::create):
(WebCore::DeviceOrientationEvent::alpha):
(WebCore::DeviceOrientationEvent::beta):
(WebCore::DeviceOrientationEvent::gamma):
(WebCore::DeviceOrientationEvent::isDeviceOrientationEvent):
* dom/DeviceOrientationEvent.idl: Added.
* dom/Event.cpp:
(WebCore::Event::isDeviceOrientationEvent):
* dom/Event.h:
* dom/EventNames.h:
* page/DOMWindow.h:
* page/DOMWindow.idl:
2010-05-20 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
Rubberstamped by Antti Koivisto.
......@@ -47,6 +47,7 @@ ENABLE_CLIENT_BASED_GEOLOCATION = ENABLE_CLIENT_BASED_GEOLOCATION;
ENABLE_DATABASE = ENABLE_DATABASE;
ENABLE_DATAGRID = ;
ENABLE_DATALIST = ENABLE_DATALIST;
ENABLE_DEVICE_ORIENTATION = ;
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
......@@ -78,4 +79,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
......@@ -69,6 +69,7 @@
#include "JSDataGridColumn.cpp"
#include "JSDataGridColumnList.cpp"
#include "JSDedicatedWorkerContext.cpp"
#include "JSDeviceOrientationEvent.cpp"
#include "JSDocument.cpp"
#include "JSDocumentFragment.cpp"
#include "JSDocumentType.cpp"
......
......@@ -117,6 +117,7 @@ DOM_CLASSES = \
Database \
DatabaseCallback \
DatabaseSync \
DeviceOrientationEvent \
Document \
DocumentFragment \
DocumentType \
......
......@@ -138,6 +138,7 @@ IDL_BINDINGS += \
Webcore/dom/CustomEvent.idl \
WebCore/dom/DOMCoreException.idl \
WebCore/dom/DOMImplementation.idl \
WebCore/dom/DeviceOrientationEvent.idl \
WebCore/dom/Document.idl \
WebCore/dom/DocumentFragment.idl \
WebCore/dom/DocumentType.idl \
......@@ -765,6 +766,8 @@ webcore_sources += \
WebCore/dom/DOMCoreException.h \
WebCore/dom/DOMImplementation.cpp \
WebCore/dom/DOMImplementation.h \
WebCore/dom/DeviceOrientationEvent.cpp \
WebCore/dom/DeviceOrientationEvent.h \
WebCore/dom/Document.cpp \
WebCore/dom/Document.h \
WebCore/dom/DocumentFragment.cpp \
......
......@@ -40,6 +40,7 @@
'dom/CustomEvent.idl',
'dom/DOMCoreException.idl',
'dom/DOMImplementation.idl',
'dom/DeviceOrientationEvent.idl',
'dom/Document.idl',
'dom/DocumentFragment.idl',
'dom/DocumentType.idl',
......@@ -1099,6 +1100,8 @@
'dom/DOMCoreException.h',
'dom/DOMImplementation.cpp',
'dom/DOMImplementation.h',
'dom/DeviceOrientationEvent.cpp',
'dom/DeviceOrientationEvent.h',
'dom/Document.cpp',
'dom/Document.h',
'dom/DocumentFragment.cpp',
......
......@@ -260,6 +260,7 @@ IDL_BINDINGS += \
dom/Comment.idl \
dom/CompositionEvent.idl \
dom/CustomEvent.idl \
dom/DeviceOrientationEvent.idl \
dom/DocumentFragment.idl \
dom/Document.idl \
dom/DocumentType.idl \
......
......@@ -462,6 +462,7 @@ SOURCES += \
dom/ContainerNode.cpp \
dom/CSSMappedAttributeDeclaration.cpp \
dom/CustomEvent.cpp \
dom/DeviceOrientationEvent.cpp \
dom/Document.cpp \
dom/DocumentFragment.cpp \
dom/DocumentType.cpp \
......@@ -1187,6 +1188,7 @@ HEADERS += \
dom/CSSMappedAttributeDeclaration.h \
dom/CustomEvent.h \
dom/default/PlatformMessagePortChannel.h \
dom/DeviceOrientationEvent.h \
dom/DocumentFragment.h \
dom/Document.h \
dom/DocumentType.h \
......
......@@ -1167,6 +1167,10 @@
596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */; };
5962297A1133EFE200DC4CBB /* GeolocationPositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 596229791133EFE200DC4CBB /* GeolocationPositionCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
599E759011055A1F00D904FA /* Bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 599E758F11055A1F00D904FA /* Bridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */; };
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */; };
59A86006119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */; };
59A86008119DAFA100DEF1EF /* JSDeviceOrientationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */; };
59A9E7B01104758800DFB4C1 /* JavaInstanceJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A9E7AF1104758800DFB4C1 /* JavaInstanceJSC.cpp */; };
59A9E7B21104759400DFB4C1 /* JavaInstanceJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A9E7B11104759400DFB4C1 /* JavaInstanceJSC.h */; };
59B597731108656B007159E8 /* BridgeJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59B597721108656B007159E8 /* BridgeJSC.cpp */; };
......@@ -6769,6 +6773,11 @@
596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
596229791133EFE200DC4CBB /* GeolocationPositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationPositionCache.h; sourceTree = "<group>"; };
599E758F11055A1F00D904FA /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bridge.h; path = bridge/Bridge.h; sourceTree = "<group>"; };
59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientationEvent.cpp; sourceTree = "<group>"; };
59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationEvent.h; sourceTree = "<group>"; };
59A85EAA119D7B6E00DEF1EF /* DeviceOrientationEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceOrientationEvent.idl; sourceTree = "<group>"; };
59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceOrientationEvent.cpp; sourceTree = "<group>"; };
59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDeviceOrientationEvent.h; sourceTree = "<group>"; };
59A9E7AF1104758800DFB4C1 /* JavaInstanceJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaInstanceJSC.cpp; path = jsc/JavaInstanceJSC.cpp; sourceTree = "<group>"; };
59A9E7B11104759400DFB4C1 /* JavaInstanceJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaInstanceJSC.h; path = jsc/JavaInstanceJSC.h; sourceTree = "<group>"; };
59B597721108656B007159E8 /* BridgeJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BridgeJSC.cpp; path = bridge/jsc/BridgeJSC.cpp; sourceTree = "<group>"; };
......@@ -14212,6 +14221,8 @@
A83B79100CCB001B000B0825 /* Core */ = {
isa = PBXGroup;
children = (
59A86007119DAFA100DEF1EF /* JSDeviceOrientationEvent.h */,
59A86005119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp */,
65DF31D809D1C122000BE325 /* JSAttr.cpp */,
65DF31D909D1C123000BE325 /* JSAttr.h */,
93F9B79E0BA6032600854064 /* JSCDATASection.cpp */,
......@@ -16406,6 +16417,9 @@
F523D32402DE4478018635CA /* dom */ = {
isa = PBXGroup;
children = (
59A85EAA119D7B6E00DEF1EF /* DeviceOrientationEvent.idl */,
59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */,
59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */,
E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
A8C4A7FC09D563270003AC8D /* Attr.cpp */,
......@@ -19265,6 +19279,8 @@
97E8B3C311A2890800169409 /* HTML5Token.h in Headers */,
A871038B11A2947000DBD50E /* HTML5Tokenizer.h in Headers */,
51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */,
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
59A86008119DAFA100DEF1EF /* JSDeviceOrientationEvent.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -21547,6 +21563,8 @@
97E8B35611A23CE200169409 /* HTML5Lexer.cpp in Sources */,
A871038A11A2947000DBD50E /* HTML5Tokenizer.cpp in Sources */,
51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */,
59A86006119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -32,11 +32,13 @@
#include "Clipboard.h"
#include "CompositionEvent.h"
#include "CustomEvent.h"
#include "DeviceOrientationEvent.h"
#include "Event.h"
#include "JSBeforeLoadEvent.h"
#include "JSClipboard.h"
#include "JSCustomEvent.h"
#include "JSCompositionEvent.h"
#include "JSDeviceOrientationEvent.h"
#include "JSErrorEvent.h"
#if ENABLE(INDEXED_DATABASE)
#include "JSIDBErrorEvent.h"
......@@ -171,6 +173,10 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event);
else if (event->isCustomEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, CustomEvent, event);
#if ENABLE(DEVICE_ORIENTATION)
else if (event->isDeviceOrientationEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, DeviceOrientationEvent, event);
#endif
else
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, Event, event);
......
......@@ -40,6 +40,7 @@
#include "V8Clipboard.h"
#include "V8CompositionEvent.h"
#include "V8CustomEvent.h"
#include "V8DeviceOrientationEvent.h"
#include "V8ErrorEvent.h"
#include "V8IDBErrorEvent.h"
#include "V8IDBSuccessEvent.h"
......@@ -153,6 +154,10 @@ v8::Handle<v8::Value> toV8(Event* impl)
#endif
if (impl->isBeforeLoadEvent())
return toV8(static_cast<BeforeLoadEvent*>(impl));
#if ENABLE(DEVICE_ORIENTATION)
if (impl->isDeviceOrientationEvent())
return toV8(static_cast<DeviceOrientationEvent*>(impl));
#endif
if (impl->isCustomEvent())
return toV8(static_cast<CustomEvent*>(impl));
return V8Event::wrap(impl);
......
/*
* Copyright 2010, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DeviceOrientationEvent.h"
#if ENABLE(DEVICE_ORIENTATION)
namespace WebCore {
DeviceOrientationEvent::DeviceOrientationEvent()
: m_alpha(0)
, m_beta(0)
, m_gamma(0)
{
}
DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, double alpha, double beta, double gamma)
: Event(eventType, false, false) // Can't bubble, not cancelable
, m_alpha(alpha)