diff options
author | Steve Block <steveblock@google.com> | 2009-10-09 16:32:56 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:45:08 +0100 |
commit | 74e159b4f10c313c2347259bd2af0a9f81eb40c6 (patch) | |
tree | 3ac8790e3abe7ca06f9a56094bee70bf11e27aaf | |
parent | 3fc3c9665962d7fc405432fd04e5851516dd4cbe (diff) | |
download | external_webkit-74e159b4f10c313c2347259bd2af0a9f81eb40c6.zip external_webkit-74e159b4f10c313c2347259bd2af0a9f81eb40c6.tar.gz external_webkit-74e159b4f10c313c2347259bd2af0a9f81eb40c6.tar.bz2 |
Merge webkit.org at R49305 : Use new macros to define Android touch event listeners for Node and DOMWindow.
See http://trac.webkit.org/changeset/48701
Change-Id: I160099dd16b222e016c3414f2ce06adf5cf52573
-rw-r--r-- | WebCore/dom/Node.cpp | 42 | ||||
-rw-r--r-- | WebCore/dom/Node.h | 12 | ||||
-rw-r--r-- | WebCore/page/DOMWindow.cpp | 42 | ||||
-rw-r--r-- | WebCore/page/DOMWindow.h | 12 |
4 files changed, 8 insertions, 100 deletions
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp index a305837..c1861cc 100644 --- a/WebCore/dom/Node.cpp +++ b/WebCore/dom/Node.cpp @@ -2894,48 +2894,6 @@ void Node::defaultEventHandler(Event* event) } } -#if ENABLE(TOUCH_EVENTS) // Android -EventListener* Node::ontouchstart() const -{ - return getAttributeEventListener(eventNames().touchstartEvent); -} - -void Node::setOntouchstart(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchstartEvent, eventListener); -} - -EventListener* Node::ontouchend() const -{ - return getAttributeEventListener(eventNames().touchendEvent); -} - -void Node::setOntouchend(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchendEvent, eventListener); -} - -EventListener* Node::ontouchmove() const -{ - return getAttributeEventListener(eventNames().touchmoveEvent); -} - -void Node::setOntouchmove(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchmoveEvent, eventListener); -} - -EventListener* Node::ontouchcancel() const -{ - return getAttributeEventListener(eventNames().touchcancelEvent); -} - -void Node::setOntouchcancel(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchcancelEvent, eventListener); -} -#endif // ENABLE(TOUCH_EVENT) - } // namespace WebCore #ifndef NDEBUG diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h index 8c6cce7..8a4c264 100644 --- a/WebCore/dom/Node.h +++ b/WebCore/dom/Node.h @@ -567,14 +567,10 @@ public: virtual bool disabled() const; #if ENABLE(TOUCH_EVENTS) // Android - EventListener* ontouchstart() const; - void setOntouchstart(PassRefPtr<EventListener>); - EventListener* ontouchend() const; - void setOntouchend(PassRefPtr<EventListener>); - EventListener* ontouchmove() const; - void setOntouchmove(PassRefPtr<EventListener>); - EventListener* ontouchcancel() const; - void setOntouchcancel(PassRefPtr<EventListener>); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); #endif using TreeShared<Node>::ref; diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index e80ce87..8bc8ec4 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -1351,46 +1351,4 @@ EventTargetData* DOMWindow::ensureEventTargetData() return &m_eventTargetData; } -#if ENABLE(TOUCH_EVENTS) // Android -EventListener* DOMWindow::ontouchstart() const -{ - return getAttributeEventListener(eventNames().touchstartEvent); -} - -void DOMWindow::setOntouchstart(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchstartEvent, eventListener); -} - -EventListener* DOMWindow::ontouchend() const -{ - return getAttributeEventListener(eventNames().touchendEvent); -} - -void DOMWindow::setOntouchend(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchendEvent, eventListener); -} - -EventListener* DOMWindow::ontouchmove() const -{ - return getAttributeEventListener(eventNames().touchmoveEvent); -} - -void DOMWindow::setOntouchmove(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchmoveEvent, eventListener); -} - -EventListener* DOMWindow::ontouchcancel() const -{ - return getAttributeEventListener(eventNames().touchcancelEvent); -} - -void DOMWindow::setOntouchcancel(PassRefPtr<EventListener> eventListener) -{ - setAttributeEventListener(eventNames().touchcancelEvent, eventListener); -} -#endif - } // namespace WebCore diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index b9b700b..c116f5b 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -321,14 +321,10 @@ namespace WebCore { DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkittransitionend, webkitTransitionEnd); #if ENABLE(TOUCH_EVENTS) // Android - EventListener* ontouchstart() const; - void setOntouchstart(PassRefPtr<EventListener>); - EventListener* ontouchend() const; - void setOntouchend(PassRefPtr<EventListener>); - EventListener* ontouchmove() const; - void setOntouchmove(PassRefPtr<EventListener>); - EventListener* ontouchcancel() const; - void setOntouchcancel(PassRefPtr<EventListener>); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); + DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); #endif void captureEvents(); |