diff options
author | Ben Murdoch <benm@google.com> | 2010-10-15 17:12:52 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-15 17:33:53 +0100 |
commit | 9dfa8dc622519374a57a0b24ab9d7f73afe160ed (patch) | |
tree | cf85774d399aa30c22eee8eff8e50c3a6de2a621 /WebCore/bindings/js/JSTouchListCustom.cpp | |
parent | 09fce604f7e67802272bf991cb667509521c36b3 (diff) | |
download | external_webkit-9dfa8dc622519374a57a0b24ab9d7f73afe160ed.zip external_webkit-9dfa8dc622519374a57a0b24ab9d7f73afe160ed.tar.gz external_webkit-9dfa8dc622519374a57a0b24ab9d7f73afe160ed.tar.bz2 |
Implement the document.createTouch and document.createTouchList APIs
These are Apple extensions to the document object present on iOS
and are used by several sites to detect touch event support.
See
http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
for Apple's documentation.
Upstreaming to webkit being tracked in
https://bugs.webkit.org/show_bug.cgi?id=47676
Bug: 2996106
Change-Id: I761b1494af60b5095ad9c47d54eb7240d47ae985
Diffstat (limited to 'WebCore/bindings/js/JSTouchListCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSTouchListCustom.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
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 |