diff options
author | Ben Murdoch <benm@google.com> | 2010-10-18 03:09:02 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-18 03:09:02 -0700 |
commit | fdbac3da7f70871a0f62e593fc068844d1f7ae84 (patch) | |
tree | b9791245515f52782dfacee7a15ddcc6edb6532c /WebCore | |
parent | ee47e11a95731328130ec0382054072fbbeb2913 (diff) | |
parent | 5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c (diff) | |
download | external_webkit-fdbac3da7f70871a0f62e593fc068844d1f7ae84.zip external_webkit-fdbac3da7f70871a0f62e593fc068844d1f7ae84.tar.gz external_webkit-fdbac3da7f70871a0f62e593fc068844d1f7ae84.tar.bz2 |
am 5013a3fb: DO NOT MERGE Implement the document.createTouch, createTouchList APIs
Merge commit '5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c' into gingerbread-plus-aosp
* commit '5013a3fb99f9ca1c7be4319cdebc7cddcaa56d7c':
DO NOT MERGE Implement the document.createTouch, createTouchList APIs
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/Android.jscbindings.mk | 2 | ||||
-rw-r--r-- | WebCore/GNUmakefile.am | 2 | ||||
-rw-r--r-- | WebCore/WebCore.gypi | 2 | ||||
-rw-r--r-- | WebCore/WebCore.pro | 2 | ||||
-rw-r--r-- | WebCore/bindings/js/JSBindingsAllInOne.cpp | 2 | ||||
-rw-r--r-- | WebCore/bindings/js/JSTouchCustom.cpp | 47 | ||||
-rw-r--r-- | WebCore/bindings/js/JSTouchListCustom.cpp | 47 | ||||
-rw-r--r-- | WebCore/bindings/scripts/CodeGeneratorJS.pm | 11 | ||||
-rw-r--r-- | WebCore/dom/Document.cpp | 13 | ||||
-rw-r--r-- | WebCore/dom/Document.h | 10 | ||||
-rw-r--r-- | WebCore/dom/Document.idl | 10 |
11 files changed, 147 insertions, 1 deletions
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk index a0a47d5..266f354 100644 --- a/WebCore/Android.jscbindings.mk +++ b/WebCore/Android.jscbindings.mk @@ -152,6 +152,8 @@ LOCAL_SRC_FILES += \ bindings/js/JSStyleSheetCustom.cpp \ bindings/js/JSStyleSheetListCustom.cpp \ bindings/js/JSTextCustom.cpp \ + bindings/js/JSTouchCustom.cpp \ + bindings/js/JSTouchListCustom.cpp \ bindings/js/JSTreeWalkerCustom.cpp \ bindings/js/JSWebKitCSSMatrixConstructor.cpp \ bindings/js/JSWebKitPointConstructor.cpp \ diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am index e0c9dc6..4f3c92f 100644 --- a/WebCore/GNUmakefile.am +++ b/WebCore/GNUmakefile.am @@ -453,6 +453,8 @@ webcore_sources += \ WebCore/bindings/js/JSStyleSheetCustom.cpp \ WebCore/bindings/js/JSStyleSheetListCustom.cpp \ WebCore/bindings/js/JSTextCustom.cpp \ + WebCore/bindings/js/JSTouchCustom.cpp \ + WebCore/bindings/js/JSTouchListCustom.cpp \ WebCore/bindings/js/JSTreeWalkerCustom.cpp \ WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp \ WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h \ diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi index 63edea7..040fbde 100644 --- a/WebCore/WebCore.gypi +++ b/WebCore/WebCore.gypi @@ -599,6 +599,8 @@ 'bindings/js/JSSVGPODListCustom.h', 'bindings/js/JSSVGPODTypeWrapper.h', 'bindings/js/JSTextCustom.cpp', + 'bindings/js/JSTouchCustom.cpp', + 'bindings/js/JSTouchListCustom.cpp', 'bindings/js/JSTreeWalkerCustom.cpp', 'bindings/js/JSWebKitCSSMatrixConstructor.cpp', 'bindings/js/JSWebKitCSSMatrixConstructor.h', diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro index 13d6314..78efcff 100644 --- a/WebCore/WebCore.pro +++ b/WebCore/WebCore.pro @@ -320,6 +320,8 @@ SOURCES += \ bindings/js/JSStyleSheetCustom.cpp \ bindings/js/JSStyleSheetListCustom.cpp \ bindings/js/JSTextCustom.cpp \ + bindings/js/JSTouchCustom.cpp \ + bindings/js/JSTouchListCustom.cpp \ bindings/js/JSTreeWalkerCustom.cpp \ bindings/js/JSWebKitCSSMatrixConstructor.cpp \ bindings/js/JSWebKitPointConstructor.cpp \ diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp index 5a0820b..bfb389e 100644 --- a/WebCore/bindings/js/JSBindingsAllInOne.cpp +++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp @@ -119,6 +119,8 @@ #include "JSStyleSheetCustom.cpp" #include "JSStyleSheetListCustom.cpp" #include "JSTextCustom.cpp" +#include "JSTouchCustom.cpp" +#include "JSTouchListCustom.cpp" #include "JSTreeWalkerCustom.cpp" #include "JSWebKitCSSMatrixConstructor.cpp" #include "JSWebKitPointConstructor.cpp" diff --git a/WebCore/bindings/js/JSTouchCustom.cpp b/WebCore/bindings/js/JSTouchCustom.cpp new file mode 100644 index 0000000..83c2b83 --- /dev/null +++ b/WebCore/bindings/js/JSTouchCustom.cpp @@ -0,0 +1,47 @@ +/* + * 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 APPLE COMPUTER, INC. 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 "JSTouch.h" + +#if ENABLE(TOUCH_EVENTS) + +#include "Touch.h" + +using namespace JSC; + +namespace WebCore { + +JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Touch* touch) +{ + if (!touch) + return jsNull(); + + return CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, Touch, touch); +} + +} // namespace WebCore + +#endif diff --git a/WebCore/bindings/js/JSTouchListCustom.cpp b/WebCore/bindings/js/JSTouchListCustom.cpp new file mode 100644 index 0000000..22e0f95 --- /dev/null +++ b/WebCore/bindings/js/JSTouchListCustom.cpp @@ -0,0 +1,47 @@ +/* + * 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 APPLE COMPUTER, INC. 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 "JSTouchList.h" + +#if ENABLE(TOUCH_EVENTS) + +#include "TouchList.h" + +using namespace JSC; + +namespace WebCore { + +JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, TouchList* touchList) +{ + if (!touchList) + return jsNull(); + + return CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, TouchList, touchList); +} + +} // namespace WebCore + +#endif diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm index 94fc2b8..599f7df 100644 --- a/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -453,6 +453,15 @@ sub GenerateGetOwnPropertyDescriptorBody return @getOwnPropertyDescriptorImpl; } +my %usesToJSNewlyCreated = ( + "CDATASection" => 1, + "Element" => 1, + "Node" => 1, + "Text" => 1, + "Touch" => 1, + "TouchList" => 1 +); + sub GenerateHeader { my $object = shift; @@ -792,7 +801,7 @@ sub GenerateHeader push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValue);\n"); } } - if ($interfaceName eq "Node" or $interfaceName eq "Element" or $interfaceName eq "Text" or $interfaceName eq "CDATASection") { + if ($usesToJSNewlyCreated{$interfaceName}) { push(@headerContent, "JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n"); } diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 1f8edeb..dca1187 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -4890,4 +4890,17 @@ InspectorTimelineAgent* Document::inspectorTimelineAgent() const } #endif +#if ENABLE(TOUCH_EVENTS) +PassRefPtr<Touch> Document::createTouch(DOMWindow* window, Node* target, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const +{ + Frame* frame = window ? window->frame() : this->frame(); + return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY); +} + +PassRefPtr<TouchList> Document::createTouchList(ExceptionCode&) const +{ + return TouchList::create(); +} +#endif + } // namespace WebCore diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index e7c470b..68e3ac5 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -133,6 +133,11 @@ namespace WebCore { struct DashboardRegionValue; #endif +#if ENABLE(TOUCH_EVENTS) + class Touch; + class TouchList; +#endif + typedef int ExceptionCode; class FormElementKey { @@ -946,6 +951,11 @@ public: bool containsValidityStyleRules() const { return m_containsValidityStyleRules; } void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; } +#if ENABLE(TOUCH_EVENTS) + PassRefPtr<Touch> createTouch(DOMWindow*, Node*, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const; + PassRefPtr<TouchList> createTouchList(ExceptionCode&) const; +#endif + protected: Document(Frame*, bool isXHTML, bool isHTML); diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl index 26ed7fd..c8cc45d 100644 --- a/WebCore/dom/Document.idl +++ b/WebCore/dom/Document.idl @@ -311,6 +311,16 @@ module core { attribute [DontEnum] EventListener ontouchmove; attribute [DontEnum] EventListener ontouchend; attribute [DontEnum] EventListener ontouchcancel; + [ReturnsNew] Touch createTouch(in DOMWindow window, + in Node target, + in long identifier, + in long pageX, + in long pageY, + in long ScreenX, + in long screenY) + raises (DOMException); + [ReturnsNew] TouchList createTouchList() + raises (DOMException); #endif #endif }; |