[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jcivelli at chromium.org jcivelli at chromium.org
Wed Dec 22 12:18:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 170e83d722ce292424aa8f2a1fb5a12492a9f332
Author: jcivelli at chromium.org <jcivelli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 18 22:05:52 2010 +0000

    2010-08-18  Jay Civelli  <jcivelli at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Renaming the WebEvent to WebDOMEvent and adding a new event class
            for mouse events so that the event listener API can be used to listen
            to them.  The renaming is needed as there already is a WebMouseEvent class.
            https://bugs.webkit.org/show_bug.cgi?id=43453
    
            * WebKit.gyp:
            * public/WebDOMEvent.h: Added.
            * public/WebDOMEventListener.h: Added.
            * public/WebDOMMouseEvent.h: Added.
            * public/WebDOMMutationEvent.h: Added.
            * public/WebNode.h:
            * src/EventListenerWrapper.cpp:
            * src/EventListenerWrapper.h:
            * src/WebDOMEvent.cpp: Added.
            * src/WebDOMEventListener.cpp: Added.
            * src/WebDOMEventListenerPrivate.cpp: Added.
            * src/WebDOMEventListenerPrivate.h: Added.
            * src/WebDOMMouseEvent.cpp: Added.
            * src/WebDOMMutationEvent.cpp: Added.
            * src/WebNode.cpp:
            (WebKit::WebNode::isElementNode):
            (WebKit::WebNode::addDOMEventListener):
            (WebKit::WebNode::removeDOMEventListener):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65633 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 0a07733..5882a7a 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,31 @@
+2010-08-18  Jay Civelli  <jcivelli at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Renaming the WebEvent to WebDOMEvent and adding a new event class
+        for mouse events so that the event listener API can be used to listen
+        to them.  The renaming is needed as there already is a WebMouseEvent class.
+        https://bugs.webkit.org/show_bug.cgi?id=43453
+
+        * WebKit.gyp:
+        * public/WebDOMEvent.h: Added.
+        * public/WebDOMEventListener.h: Added.
+        * public/WebDOMMouseEvent.h: Added.
+        * public/WebDOMMutationEvent.h: Added.
+        * public/WebNode.h:
+        * src/EventListenerWrapper.cpp:
+        * src/EventListenerWrapper.h:
+        * src/WebDOMEvent.cpp: Added.
+        * src/WebDOMEventListener.cpp: Added.
+        * src/WebDOMEventListenerPrivate.cpp: Added.
+        * src/WebDOMEventListenerPrivate.h: Added.
+        * src/WebDOMMouseEvent.cpp: Added.
+        * src/WebDOMMutationEvent.cpp: Added.
+        * src/WebNode.cpp:
+        (WebKit::WebNode::isElementNode):
+        (WebKit::WebNode::addDOMEventListener):
+        (WebKit::WebNode::removeDOMEventListener):
+
 2010-08-17  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index d12bee7..e509f70 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -134,6 +134,10 @@
                 'public/WebCrossOriginPreflightResultCache.h',
                 'public/WebCString.h',
                 'public/WebCursorInfo.h',
+                'public/WebDOMEvent.h',
+                'public/WebDOMEventListener.h',
+                'public/WebDOMMouseEvent.h',
+                'public/WebDOMMutationEvent.h',
                 'public/WebDOMStringList.h',
                 'public/WebData.h',
                 'public/WebDatabase.h',
@@ -381,6 +385,12 @@
                 'src/WebCrossOriginPreflightResultCache.cpp',
                 'src/WebCString.cpp',
                 'src/WebCursorInfo.cpp',
+                'src/WebDOMEvent.cpp',
+                'src/WebDOMEventListener.cpp',
+                'src/WebDOMEventListenerPrivate.cpp',
+                'src/WebDOMEventListenerPrivate.h',
+                'src/WebDOMMouseEvent.cpp',
+                'src/WebDOMMutationEvent.cpp',
                 'src/WebDOMStringList.cpp',
                 'src/WebData.cpp',
                 'src/WebDatabase.cpp',
diff --git a/WebKit/chromium/public/WebDOMEvent.h b/WebKit/chromium/public/WebDOMEvent.h
new file mode 100644
index 0000000..d34c8d4
--- /dev/null
+++ b/WebKit/chromium/public/WebDOMEvent.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef WebDOMEvent_h
+#define WebDOMEvent_h
+
+#include "WebCommon.h"
+#include "WebNode.h"
+#include "WebString.h"
+
+namespace WebCore { class Event; }
+#if WEBKIT_IMPLEMENTATION
+namespace WTF { template <typename T> class PassRefPtr; }
+#endif
+
+namespace WebKit {
+
+class WebDOMEvent {
+public:
+    enum PhaseType {
+        CapturingPhase     = 1,
+        AtTarget           = 2,
+        BubblingPhase      = 3
+    };
+
+    WebDOMEvent() : m_private(0) { }
+    WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); }
+    WebDOMEvent& operator=(const WebDOMEvent& e)
+    {
+        assign(e);
+        return *this;
+    }
+
+    WEBKIT_API void reset();
+    WEBKIT_API void assign(const WebDOMEvent&);
+
+    bool isNull() const { return !m_private; }
+
+    WEBKIT_API WebString type() const;
+    WEBKIT_API WebNode target() const;
+    WEBKIT_API WebNode currentTarget() const;
+
+    WEBKIT_API PhaseType eventPhase() const;
+    WEBKIT_API bool bubbles() const;
+    WEBKIT_API bool cancelable() const;
+
+    WEBKIT_API bool isUIEvent() const;
+    WEBKIT_API bool isMouseEvent() const;
+    WEBKIT_API bool isMutationEvent() const;
+    WEBKIT_API bool isKeyboardEvent() const;
+    WEBKIT_API bool isTextEvent() const;
+    WEBKIT_API bool isCompositionEvent() const;
+    WEBKIT_API bool isDragEvent() const;
+    WEBKIT_API bool isClipboardEvent() const;
+    WEBKIT_API bool isMessageEvent() const;
+    WEBKIT_API bool isWheelEvent() const;
+    WEBKIT_API bool isBeforeTextInsertedEvent() const;
+    WEBKIT_API bool isOverflowEvent() const;
+    WEBKIT_API bool isPageTransitionEvent() const;
+    WEBKIT_API bool isPopStateEvent() const;
+    WEBKIT_API bool isProgressEvent() const;
+    WEBKIT_API bool isXMLHttpRequestProgressEvent() const;
+    WEBKIT_API bool isWebKitAnimationEvent() const;
+    WEBKIT_API bool isWebKitTransitionEvent() const;
+    WEBKIT_API bool isBeforeLoadEvent() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>&);
+#endif
+
+    template<typename T> T to()
+    {
+        T res;
+        res.WebDOMEvent::assign(*this);
+        return res;
+    }
+
+    template<typename T> const T toConst() const
+    {
+        T res;
+        res.WebDOMEvent::assign(*this);
+        return res;
+    }
+
+protected:
+    typedef WebCore::Event WebDOMEventPrivate;
+    void assign(WebDOMEventPrivate*);
+    WebDOMEventPrivate* m_private;
+
+    template<typename T> T* unwrap()
+    {
+        return static_cast<T*>(m_private);
+    }
+
+    template<typename T> const T* constUnwrap() const
+    {
+        return static_cast<const T*>(m_private);
+    }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebDOMEventListener.h b/WebKit/chromium/public/WebDOMEventListener.h
new file mode 100644
index 0000000..4b32b93
--- /dev/null
+++ b/WebKit/chromium/public/WebDOMEventListener.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef WebDOMEventListener_h
+#define WebDOMEventListener_h
+
+#include "WebCommon.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class Node; }
+#endif
+
+namespace WebKit {
+
+class EventListenerWrapper;
+class WebDOMEvent;
+class WebDOMEventListenerPrivate;
+class WebNode;
+class WebString;
+
+class WebDOMEventListener {
+public:
+    WEBKIT_API WebDOMEventListener();
+    WEBKIT_API virtual ~WebDOMEventListener();
+
+    // Called when an event is received.
+    virtual void handleEvent(const WebDOMEvent&) = 0;
+
+#if WEBKIT_IMPLEMENTATION
+    void notifyEventListenerDeleted(EventListenerWrapper*);
+    EventListenerWrapper* createEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
+    EventListenerWrapper* getEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
+#endif
+
+private:
+    WebDOMEventListenerPrivate* m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebDOMMouseEvent.h b/WebKit/chromium/public/WebDOMMouseEvent.h
new file mode 100644
index 0000000..4c38b56
--- /dev/null
+++ b/WebKit/chromium/public/WebDOMMouseEvent.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+#ifndef WebDOMMouseEvent_h
+#define WebDOMMouseEvent_h
+
+#include "WebDOMEvent.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class Event; }
+#endif
+
+namespace WebKit {
+
+class WebDOMMouseEvent : public WebDOMEvent {
+public:
+    WEBKIT_API int screenX() const;
+    WEBKIT_API int screenY() const;
+    WEBKIT_API int clientX() const;
+    WEBKIT_API int clientY() const;
+    WEBKIT_API int layerX() const;
+    WEBKIT_API int layerY() const;
+    WEBKIT_API int offsetX() const;
+    WEBKIT_API int offsetY() const;
+    WEBKIT_API int pageX() const;
+    WEBKIT_API int pageY() const;
+    WEBKIT_API int x() const;
+    WEBKIT_API int y() const;
+
+    WEBKIT_API int button() const;
+    WEBKIT_API bool buttonDown() const;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebDOMMutationEvent.h b/WebKit/chromium/public/WebDOMMutationEvent.h
new file mode 100644
index 0000000..471331f
--- /dev/null
+++ b/WebKit/chromium/public/WebDOMMutationEvent.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+#ifndef WebDOMMutationEvent_h
+#define WebDOMMutationEvent_h
+
+#include "WebDOMEvent.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class Event; }
+#endif
+
+namespace WebKit {
+
+class WebDOMMutationEvent : public WebDOMEvent {
+public:
+    enum AttrChangeType {
+        Modification    = 1,
+        Addition        = 2,
+        Removal         = 3
+    };
+
+    WEBKIT_API WebNode relatedNode() const;
+    WEBKIT_API WebString prevValue() const;
+    WEBKIT_API WebString newValue() const;
+    WEBKIT_API WebString attrName() const;
+    WEBKIT_API AttrChangeType attrChange() const;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebEventListener.h b/WebKit/chromium/public/WebEventListener.h
index 62ca0de..baab8f0 100644
--- a/WebKit/chromium/public/WebEventListener.h
+++ b/WebKit/chromium/public/WebEventListener.h
@@ -39,7 +39,7 @@ namespace WebCore { class Node; }
 
 namespace WebKit {
 
-class EventListenerWrapper;
+class DeprecatedEventListenerWrapper;
 class WebEvent;
 class WebEventListenerPrivate;
 class WebNode;
@@ -54,9 +54,9 @@ public:
     virtual void handleEvent(const WebEvent&) = 0;
 
 #if WEBKIT_IMPLEMENTATION
-    void notifyEventListenerDeleted(EventListenerWrapper*);
-    EventListenerWrapper* createEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
-    EventListenerWrapper* getEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
+    void notifyEventListenerDeleted(DeprecatedEventListenerWrapper*);
+    DeprecatedEventListenerWrapper* createEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
+    DeprecatedEventListenerWrapper* getEventListenerWrapper(const WebString& eventType, bool useCapture, WebCore::Node* node);
 #endif
 
 private:
diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h
index fb0a99e..8b29cc6 100644
--- a/WebKit/chromium/public/WebNode.h
+++ b/WebKit/chromium/public/WebNode.h
@@ -38,6 +38,8 @@
 namespace WebCore { class Node; }
 
 namespace WebKit {
+class WebDOMEventListener;
+class WebDOMEventListenerPrivate;
 class WebDocument;
 class WebEventListener;
 class WebEventListenerPrivate;
@@ -97,6 +99,8 @@ public:
     WEBKIT_API WebString createMarkup() const;
     WEBKIT_API bool isTextNode() const;
     WEBKIT_API bool isElementNode() const;
+    WEBKIT_API void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture);
+    WEBKIT_API void removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture);
     WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture);
     WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture);
     WEBKIT_API void simulateClick();
diff --git a/WebKit/chromium/src/EventListenerWrapper.cpp b/WebKit/chromium/src/EventListenerWrapper.cpp
index f2d2979..d683561 100644
--- a/WebKit/chromium/src/EventListenerWrapper.cpp
+++ b/WebKit/chromium/src/EventListenerWrapper.cpp
@@ -1,72 +1,104 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 "EventListenerWrapper.h"
-
-#include "Event.h"
-#include "EventListener.h"
-
-#include "WebEvent.h"
-#include "WebEventListener.h"
-
-namespace WebKit {
-
-EventListenerWrapper::EventListenerWrapper(WebEventListener* webEventListener)
-    : EventListener(EventListener::JSEventListenerType)
-    , m_webEventListener(webEventListener)
-{
-}
-
-EventListenerWrapper::~EventListenerWrapper()
-{
-    if (m_webEventListener)
-        m_webEventListener->notifyEventListenerDeleted(this);
-}
-
-bool EventListenerWrapper::operator==(const EventListener& listener)
-{
-    return this == &listener;
-}
-
-void EventListenerWrapper::handleEvent(ScriptExecutionContext* context, Event* event)
-{
-    if (!m_webEventListener)
-        return;
-    WebEvent webEvent(event);
-    m_webEventListener->handleEvent(webEvent);
-}
-
-void EventListenerWrapper::webEventListenerDeleted()
-{
-    m_webEventListener = 0;
-}
-
-} // namespace WebKit
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "EventListenerWrapper.h"
+
+#include "Event.h"
+#include "EventListener.h"
+
+#include "WebDOMEvent.h"
+#include "WebDOMEventListener.h"
+#include "WebEvent.h"
+#include "WebEventListener.h"
+
+namespace WebKit {
+
+EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener)
+    : EventListener(EventListener::JSEventListenerType)
+    , m_webDOMEventListener(webDOMEventListener)
+{
+}
+
+EventListenerWrapper::~EventListenerWrapper()
+{
+    if (m_webDOMEventListener)
+        m_webDOMEventListener->notifyEventListenerDeleted(this);
+}
+
+bool EventListenerWrapper::operator==(const EventListener& listener)
+{
+    return this == &listener;
+}
+
+void EventListenerWrapper::handleEvent(ScriptExecutionContext* context, Event* event)
+{
+    if (!m_webDOMEventListener)
+        return;
+    WebDOMEvent webDOMEvent(event);
+    m_webDOMEventListener->handleEvent(webDOMEvent);
+}
+
+void EventListenerWrapper::webDOMEventListenerDeleted()
+{
+    m_webDOMEventListener = 0;
+}
+
+DeprecatedEventListenerWrapper::DeprecatedEventListenerWrapper(WebEventListener* webEventListener)
+    : EventListener(EventListener::JSEventListenerType)
+    , m_webEventListener(webEventListener)
+{
+}
+
+DeprecatedEventListenerWrapper::~DeprecatedEventListenerWrapper()
+{
+    if (m_webEventListener)
+        m_webEventListener->notifyEventListenerDeleted(this);
+}
+
+bool DeprecatedEventListenerWrapper::operator==(const EventListener& listener)
+{
+    return this == &listener;
+}
+
+void DeprecatedEventListenerWrapper::handleEvent(ScriptExecutionContext* context, Event* event)
+{
+    if (!m_webEventListener)
+        return;
+    WebEvent webEvent(event);
+    m_webEventListener->handleEvent(webEvent);
+}
+
+void DeprecatedEventListenerWrapper::webEventListenerDeleted()
+{
+    m_webEventListener = 0;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/EventListenerWrapper.h b/WebKit/chromium/src/EventListenerWrapper.h
index 2a0cbbb..60afca6 100644
--- a/WebKit/chromium/src/EventListenerWrapper.h
+++ b/WebKit/chromium/src/EventListenerWrapper.h
@@ -1,62 +1,80 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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.
- */
-
-#ifndef EventListenerWrapper_h
-#define EventListenerWrapper_h
-
-#include "EventListener.h"
-
-namespace WebCore {
-class ScriptExecutionContext;
-}
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class WebEventListener;
-
-class EventListenerWrapper : public EventListener {
-public:
-    EventListenerWrapper(WebEventListener*);
-    ~EventListenerWrapper();
-
-    virtual bool operator==(const EventListener&);
-    virtual void handleEvent(ScriptExecutionContext*, Event*);
-
-    void webEventListenerDeleted();
-
-private:
-    WebEventListener* m_webEventListener;
-};
-
-} // namespace WebKit
-
-#endif
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef EventListenerWrapper_h
+#define EventListenerWrapper_h
+
+#include "EventListener.h"
+
+namespace WebCore {
+class ScriptExecutionContext;
+}
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class WebDOMEventListener;
+class WebEventListener;
+
+// FIXME: Remove the DeprecatedEventListenerWrapper class below once Chromium
+// switched to using WebDOMEvent.
+class EventListenerWrapper : public EventListener {
+public:
+    EventListenerWrapper(WebDOMEventListener*);
+    ~EventListenerWrapper();
+
+    virtual bool operator==(const EventListener&);
+    virtual void handleEvent(ScriptExecutionContext*, Event*);
+
+    void webDOMEventListenerDeleted();
+
+private:
+    WebDOMEventListener* m_webDOMEventListener;
+};
+
+class DeprecatedEventListenerWrapper : public EventListener {
+public:
+    DeprecatedEventListenerWrapper(WebEventListener*);
+    ~DeprecatedEventListenerWrapper();
+
+    virtual bool operator==(const EventListener&);
+    virtual void handleEvent(ScriptExecutionContext*, Event*);
+
+    void webEventListenerDeleted();
+
+private:
+    WebEventListener* m_webEventListener;
+};
+
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebDOMEvent.cpp b/WebKit/chromium/src/WebDOMEvent.cpp
new file mode 100644
index 0000000..48e5268
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMEvent.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebDOMEvent.h"
+
+#include "Event.h"
+#include "Node.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class WebDOMEventPrivate : public WebCore::Event {
+};
+
+void WebDOMEvent::reset()
+{
+    assign(0);
+}
+
+void WebDOMEvent::assign(const WebDOMEvent& other)
+{
+    WebDOMEventPrivate* p = const_cast<WebDOMEventPrivate*>(other.m_private);
+    if (p)
+        p->ref();
+    assign(p);
+}
+
+void WebDOMEvent::assign(WebDOMEventPrivate* p)
+{
+    // p is already ref'd for us by the caller
+    if (m_private)
+        m_private->deref();
+    m_private = p;
+}
+
+WebDOMEvent::WebDOMEvent(const WTF::PassRefPtr<WebCore::Event>& event)
+    : m_private(static_cast<WebDOMEventPrivate*>(event.releaseRef()))
+{
+}
+
+WebString WebDOMEvent::type() const
+{
+    ASSERT(m_private);
+    return m_private->type();
+}
+
+WebNode WebDOMEvent::target() const
+{
+    ASSERT(m_private);
+    return WebNode(m_private->target()->toNode());
+}
+
+WebNode WebDOMEvent::currentTarget() const
+{
+    ASSERT(m_private);
+    return WebNode(m_private->currentTarget()->toNode());
+}
+
+WebDOMEvent::PhaseType WebDOMEvent::eventPhase() const
+{
+    ASSERT(m_private);
+    return static_cast<WebDOMEvent::PhaseType>(m_private->eventPhase());
+}
+
+bool WebDOMEvent::bubbles() const
+{
+    ASSERT(m_private);
+    return m_private->bubbles();
+}
+
+bool WebDOMEvent::cancelable() const
+{
+    ASSERT(m_private);
+    return m_private->cancelable();
+}
+
+bool WebDOMEvent::isUIEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isUIEvent();
+}
+
+bool WebDOMEvent::isMouseEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isMouseEvent();
+}
+
+bool WebDOMEvent::isMutationEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isMutationEvent();
+}
+
+bool WebDOMEvent::isKeyboardEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isKeyboardEvent();
+}
+
+bool WebDOMEvent::isTextEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isTextEvent();
+}
+
+bool WebDOMEvent::isCompositionEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isCompositionEvent();
+}
+
+bool WebDOMEvent::isDragEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isDragEvent();
+}
+
+bool WebDOMEvent::isClipboardEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isClipboardEvent();
+}
+
+bool WebDOMEvent::isMessageEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isMessageEvent();
+}
+
+bool WebDOMEvent::isWheelEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isWheelEvent();
+}
+
+bool WebDOMEvent::isBeforeTextInsertedEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isBeforeTextInsertedEvent();
+}
+
+bool WebDOMEvent::isOverflowEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isOverflowEvent();
+}
+
+bool WebDOMEvent::isPageTransitionEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isPageTransitionEvent();
+}
+
+bool WebDOMEvent::isPopStateEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isPopStateEvent();
+}
+
+bool WebDOMEvent::isProgressEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isProgressEvent();
+}
+
+bool WebDOMEvent::isXMLHttpRequestProgressEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isXMLHttpRequestProgressEvent();
+}
+
+bool WebDOMEvent::isWebKitAnimationEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isWebKitAnimationEvent();
+}
+
+bool WebDOMEvent::isWebKitTransitionEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isWebKitTransitionEvent();
+}
+
+bool WebDOMEvent::isBeforeLoadEvent() const
+{
+    ASSERT(m_private);
+    return m_private->isBeforeLoadEvent();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDOMEventListener.cpp b/WebKit/chromium/src/WebDOMEventListener.cpp
new file mode 100644
index 0000000..93c1640
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMEventListener.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebDOMEventListener.h"
+
+#include "WebDOMEventListenerPrivate.h"
+
+namespace WebKit {
+
+WebDOMEventListener::WebDOMEventListener()
+    : m_private(new WebDOMEventListenerPrivate(this))
+{
+}
+
+WebDOMEventListener::~WebDOMEventListener()
+{
+    m_private->webDOMEventListenerDeleted();
+    delete m_private;
+}
+
+void WebDOMEventListener::notifyEventListenerDeleted(EventListenerWrapper* wrapper)
+{
+    m_private->eventListenerDeleted(wrapper);
+}
+
+EventListenerWrapper* WebDOMEventListener::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    return m_private->createEventListenerWrapper(eventType, useCapture, node);
+}
+
+EventListenerWrapper* WebDOMEventListener::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    return m_private->getEventListenerWrapper(eventType, useCapture, node);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp b/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp
new file mode 100644
index 0000000..4edbeef
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebDOMEventListenerPrivate.h"
+
+#include "EventListenerWrapper.h"
+#include "WebDOMEventListener.h"
+
+namespace WebKit {
+
+WebDOMEventListenerPrivate::WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener)
+    : m_webDOMEventListener(webDOMEventListener)
+{
+}
+
+WebDOMEventListenerPrivate::~WebDOMEventListenerPrivate()
+{
+}
+
+EventListenerWrapper* WebDOMEventListenerPrivate::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    EventListenerWrapper* listenerWrapper = new EventListenerWrapper(m_webDOMEventListener);
+    WebDOMEventListenerPrivate::ListenerInfo listenerInfo(eventType, useCapture, listenerWrapper, node);
+    m_listenerWrappers.append(listenerInfo);
+    return listenerWrapper;
+}
+
+EventListenerWrapper* WebDOMEventListenerPrivate::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    Vector<WebDOMEventListenerPrivate::ListenerInfo>::const_iterator iter;
+    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) {
+        if (iter->node == node)
+          return iter->eventListenerWrapper;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+void WebDOMEventListenerPrivate::webDOMEventListenerDeleted()
+{
+    // Notifies all WebDOMEventListenerWrappers that we are going away so they can
+    // invalidate their pointer to us.
+    Vector<WebDOMEventListenerPrivate::ListenerInfo>::const_iterator iter;
+    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter)
+        iter->eventListenerWrapper->webDOMEventListenerDeleted();
+}
+
+void WebDOMEventListenerPrivate::eventListenerDeleted(EventListenerWrapper* eventListener)
+{
+    for (size_t i = 0; i < m_listenerWrappers.size(); ++i) {
+        if (m_listenerWrappers[i].eventListenerWrapper == eventListener) {
+            m_listenerWrappers.remove(i);
+            return;
+        }
+    }
+    ASSERT_NOT_REACHED();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDOMEventListenerPrivate.h b/WebKit/chromium/src/WebDOMEventListenerPrivate.h
new file mode 100644
index 0000000..c86f427
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMEventListenerPrivate.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef WebDOMEventListenerPrivate_h
+#define WebDOMEventListenerPrivate_h
+
+#include "WebString.h"
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+class Node;
+}
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class EventListenerWrapper;
+class WebDOMEventListener;
+
+class WebDOMEventListenerPrivate {
+public:
+    WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener);
+    ~WebDOMEventListenerPrivate();
+
+    EventListenerWrapper* createEventListenerWrapper(
+        const WebString& eventType, bool useCapture, Node* node);
+
+    // Gets the ListenerEventWrapper for a specific node.
+    // Used by WebNode::removeDOMEventListener().
+    EventListenerWrapper* getEventListenerWrapper(
+        const WebString& eventType, bool useCapture, Node* node);
+
+    // Called by the WebDOMEventListener when it is about to be deleted.
+    void webDOMEventListenerDeleted();
+
+    // Called by the EventListenerWrapper when it is about to be deleted.
+    void eventListenerDeleted(EventListenerWrapper* eventListener);
+
+    struct ListenerInfo {
+        ListenerInfo(const WebString& eventType, bool useCapture,
+                     EventListenerWrapper* eventListenerWrapper,
+                     Node* node)
+            : eventType(eventType)
+            , useCapture(useCapture)
+            , eventListenerWrapper(eventListenerWrapper)
+            , node(node)
+        {
+        }
+
+        WebString eventType;
+        bool useCapture;
+        EventListenerWrapper* eventListenerWrapper;
+        Node* node;
+    };
+
+private:
+    WebDOMEventListener* m_webDOMEventListener;
+
+    // We keep a list of the wrapper for the WebKit EventListener, it is needed
+    // to implement WebNode::removeEventListener().
+    Vector<ListenerInfo> m_listenerWrappers;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebDOMMouseEvent.cpp b/WebKit/chromium/src/WebDOMMouseEvent.cpp
new file mode 100644
index 0000000..bfeae37
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMMouseEvent.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebDOMMouseEvent.h"
+
+#include "MouseEvent.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+int WebDOMMouseEvent::screenX() const
+{
+    return constUnwrap<MouseEvent>()->screenX();
+}
+
+int WebDOMMouseEvent::screenY() const
+{
+    return constUnwrap<MouseEvent>()->screenY();
+}
+
+int WebDOMMouseEvent::clientX() const
+{
+    return constUnwrap<MouseEvent>()->clientX();
+}
+
+int WebDOMMouseEvent::clientY() const
+{
+    return constUnwrap<MouseEvent>()->clientY();
+}
+
+int WebDOMMouseEvent::layerX() const
+{
+    return constUnwrap<MouseEvent>()->layerX();
+}
+
+int WebDOMMouseEvent::layerY() const
+{
+    return constUnwrap<MouseEvent>()->layerY();
+}
+
+int WebDOMMouseEvent::offsetX() const
+{
+    return constUnwrap<MouseEvent>()->offsetX();
+}
+
+int WebDOMMouseEvent::offsetY() const
+{
+    return constUnwrap<MouseEvent>()->offsetY();
+}
+
+int WebDOMMouseEvent::pageX() const
+{
+    return constUnwrap<MouseEvent>()->pageX();
+}
+
+int WebDOMMouseEvent::pageY() const
+{
+    return constUnwrap<MouseEvent>()->pageY();
+}
+
+int WebDOMMouseEvent::x() const
+{
+    return constUnwrap<MouseEvent>()->x();
+}
+
+int WebDOMMouseEvent::y() const
+{
+    return constUnwrap<MouseEvent>()->y();
+}
+
+int WebDOMMouseEvent::button() const
+{
+    return constUnwrap<MouseEvent>()->button();
+}
+
+bool WebDOMMouseEvent::buttonDown() const
+{
+    return constUnwrap<MouseEvent>()->buttonDown();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDOMMutationEvent.cpp b/WebKit/chromium/src/WebDOMMutationEvent.cpp
new file mode 100644
index 0000000..8a6e592
--- /dev/null
+++ b/WebKit/chromium/src/WebDOMMutationEvent.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebDOMMutationEvent.h"
+
+#include "MutationEvent.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebNode WebDOMMutationEvent::relatedNode() const
+{
+    return WebNode(constUnwrap<MutationEvent>()->relatedNode());
+}
+
+WebString WebDOMMutationEvent::prevValue() const
+{
+    return WebString(constUnwrap<MutationEvent>()->prevValue());
+}
+
+WebString WebDOMMutationEvent::newValue() const
+{
+    return WebString(constUnwrap<MutationEvent>()->newValue());
+}
+
+WebString WebDOMMutationEvent::attrName() const
+{
+    return WebString(constUnwrap<MutationEvent>()->attrName());
+}
+
+WebDOMMutationEvent::AttrChangeType WebDOMMutationEvent::attrChange() const
+{
+    return static_cast<AttrChangeType>(constUnwrap<MutationEvent>()->attrChange());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebEventListener.cpp b/WebKit/chromium/src/WebEventListener.cpp
index 8d9a887..1abce1b 100644
--- a/WebKit/chromium/src/WebEventListener.cpp
+++ b/WebKit/chromium/src/WebEventListener.cpp
@@ -1,64 +1,64 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 "WebEventListener.h"
-
-#include "WebEventListenerPrivate.h"
-
-namespace WebKit {
-
-WebEventListener::WebEventListener()
-    : m_private(new WebEventListenerPrivate(this))
-{
-}
-
-WebEventListener::~WebEventListener()
-{
-    m_private->webEventListenerDeleted();
-    delete m_private;
-}
-
-void WebEventListener::notifyEventListenerDeleted(EventListenerWrapper* wrapper)
-{
-    m_private->eventListenerDeleted(wrapper);
-}
-
-EventListenerWrapper* WebEventListener::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
-    return m_private->createEventListenerWrapper(eventType, useCapture, node);
-}
-
-EventListenerWrapper* WebEventListener::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
-    return m_private->getEventListenerWrapper(eventType, useCapture, node);
-}
-
-} // namespace WebKit
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebEventListener.h"
+
+#include "WebEventListenerPrivate.h"
+
+namespace WebKit {
+
+WebEventListener::WebEventListener()
+    : m_private(new WebEventListenerPrivate(this))
+{
+}
+
+WebEventListener::~WebEventListener()
+{
+    m_private->webEventListenerDeleted();
+    delete m_private;
+}
+
+void WebEventListener::notifyEventListenerDeleted(DeprecatedEventListenerWrapper* wrapper)
+{
+    m_private->eventListenerDeleted(wrapper);
+}
+
+DeprecatedEventListenerWrapper* WebEventListener::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    return m_private->createEventListenerWrapper(eventType, useCapture, node);
+}
+
+DeprecatedEventListenerWrapper* WebEventListener::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    return m_private->getEventListenerWrapper(eventType, useCapture, node);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebEventListenerPrivate.cpp b/WebKit/chromium/src/WebEventListenerPrivate.cpp
index bd14baf..ebb39aa 100644
--- a/WebKit/chromium/src/WebEventListenerPrivate.cpp
+++ b/WebKit/chromium/src/WebEventListenerPrivate.cpp
@@ -1,87 +1,87 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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 "WebEventListenerPrivate.h"
-
-#include "EventListenerWrapper.h"
-#include "WebEventListener.h"
-
-namespace WebKit {
-
-WebEventListenerPrivate::WebEventListenerPrivate(WebEventListener* webEventListener)
-    : m_webEventListener(webEventListener)
-{
-}
-
-WebEventListenerPrivate::~WebEventListenerPrivate()
-{
-}
-
-EventListenerWrapper* WebEventListenerPrivate::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
-    EventListenerWrapper* listenerWrapper = new EventListenerWrapper(m_webEventListener);
-    WebEventListenerPrivate::ListenerInfo listenerInfo(eventType, useCapture, listenerWrapper, node);
-    m_listenerWrappers.append(listenerInfo);
-    return listenerWrapper;
-}
-
-EventListenerWrapper* WebEventListenerPrivate::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
-{
-    Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
-    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) {
-        if (iter->node == node)
-          return iter->eventListenerWrapper;
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-void WebEventListenerPrivate::webEventListenerDeleted()
-{
-    // Notifies all WebEventListenerWrappers that we are going away so they can
-    // invalidate their pointer to us.
-    Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
-    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter)
-        iter->eventListenerWrapper->webEventListenerDeleted();
-}
-
-void WebEventListenerPrivate::eventListenerDeleted(EventListenerWrapper* eventListener)
-{
-    for (size_t i = 0; i < m_listenerWrappers.size(); ++i) {
-        if (m_listenerWrappers[i].eventListenerWrapper == eventListener) {
-            m_listenerWrappers.remove(i);
-            return;
-        }
-    }
-    ASSERT_NOT_REACHED();
-}
-
-} // namespace WebKit
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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 "WebEventListenerPrivate.h"
+
+#include "EventListenerWrapper.h"
+#include "WebEventListener.h"
+
+namespace WebKit {
+
+WebEventListenerPrivate::WebEventListenerPrivate(WebEventListener* webEventListener)
+    : m_webEventListener(webEventListener)
+{
+}
+
+WebEventListenerPrivate::~WebEventListenerPrivate()
+{
+}
+
+DeprecatedEventListenerWrapper* WebEventListenerPrivate::createEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    DeprecatedEventListenerWrapper* listenerWrapper = new DeprecatedEventListenerWrapper(m_webEventListener);
+    WebEventListenerPrivate::ListenerInfo listenerInfo(eventType, useCapture, listenerWrapper, node);
+    m_listenerWrappers.append(listenerInfo);
+    return listenerWrapper;
+}
+
+DeprecatedEventListenerWrapper* WebEventListenerPrivate::getEventListenerWrapper(const WebString& eventType, bool useCapture, Node* node)
+{
+    Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
+    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter) {
+        if (iter->node == node)
+          return iter->eventListenerWrapper;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+void WebEventListenerPrivate::webEventListenerDeleted()
+{
+    // Notifies all WebEventListenerWrappers that we are going away so they can
+    // invalidate their pointer to us.
+    Vector<WebEventListenerPrivate::ListenerInfo>::const_iterator iter;
+    for (iter = m_listenerWrappers.begin(); iter != m_listenerWrappers.end(); ++iter)
+        iter->eventListenerWrapper->webEventListenerDeleted();
+}
+
+void WebEventListenerPrivate::eventListenerDeleted(DeprecatedEventListenerWrapper* eventListener)
+{
+    for (size_t i = 0; i < m_listenerWrappers.size(); ++i) {
+        if (m_listenerWrappers[i].eventListenerWrapper == eventListener) {
+            m_listenerWrappers.remove(i);
+            return;
+        }
+    }
+    ASSERT_NOT_REACHED();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebEventListenerPrivate.h b/WebKit/chromium/src/WebEventListenerPrivate.h
index 0ba2b5d..fc2612b 100644
--- a/WebKit/chromium/src/WebEventListenerPrivate.h
+++ b/WebKit/chromium/src/WebEventListenerPrivate.h
@@ -1,95 +1,95 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "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.
- */
-
-#ifndef WebEventListenerPrivate_h
-#define WebEventListenerPrivate_h
-
-#include "WebString.h"
-
-#include <wtf/Vector.h>
-
-namespace WebCore {
-class Node;
-}
-
-using namespace WebCore;
-
-namespace WebKit {
-
-class EventListenerWrapper;
-class WebEventListener;
-
-class WebEventListenerPrivate {
-public:
-    WebEventListenerPrivate(WebEventListener* webEventListener);
-    ~WebEventListenerPrivate();
-
-    EventListenerWrapper* createEventListenerWrapper(
-        const WebString& eventType, bool useCapture, Node* node);
-
-    // Gets the ListenerEventWrapper for a specific node.
-    // Used by WebNode::removeEventListener().
-    EventListenerWrapper* getEventListenerWrapper(
-        const WebString& eventType, bool useCapture, Node* node);
-
-    // Called by the WebEventListener when it is about to be deleted.
-    void webEventListenerDeleted();
-
-    // Called by the EventListenerWrapper when it is about to be deleted.
-    void eventListenerDeleted(EventListenerWrapper* eventListener);
-
-    struct ListenerInfo {
-        ListenerInfo(const WebString& eventType, bool useCapture,
-                     EventListenerWrapper* eventListenerWrapper,
-                     Node* node)
-            : eventType(eventType)
-            , useCapture(useCapture)
-            , eventListenerWrapper(eventListenerWrapper)
-            , node(node)
-        {
-        }
-
-        WebString eventType;
-        bool useCapture;
-        EventListenerWrapper* eventListenerWrapper;
-        Node* node;
-    };
-
-private:
-    WebEventListener* m_webEventListener;
-
-    // We keep a list of the wrapper for the WebKit EventListener, it is needed
-    // to implement WebNode::removeEventListener().
-    Vector<ListenerInfo> m_listenerWrappers;
-};
-
-} // namespace WebKit
-
-#endif
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#ifndef WebEventListenerPrivate_h
+#define WebEventListenerPrivate_h
+
+#include "WebString.h"
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+class Node;
+}
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class DeprecatedEventListenerWrapper;
+class WebEventListener;
+
+class WebEventListenerPrivate {
+public:
+    WebEventListenerPrivate(WebEventListener* webEventListener);
+    ~WebEventListenerPrivate();
+
+    DeprecatedEventListenerWrapper* createEventListenerWrapper(
+        const WebString& eventType, bool useCapture, Node* node);
+
+    // Gets the DeprecatedEventListenerWrapper for a specific node.
+    // Used by WebNode::removeEventListener().
+    DeprecatedEventListenerWrapper* getEventListenerWrapper(
+        const WebString& eventType, bool useCapture, Node* node);
+
+    // Called by the WebEventListener when it is about to be deleted.
+    void webEventListenerDeleted();
+
+    // Called by the DeprecatedEventListenerWrapper when it is about to be deleted.
+    void eventListenerDeleted(DeprecatedEventListenerWrapper* eventListener);
+
+    struct ListenerInfo {
+        ListenerInfo(const WebString& eventType, bool useCapture,
+                     DeprecatedEventListenerWrapper* eventListenerWrapper,
+                     Node* node)
+            : eventType(eventType)
+            , useCapture(useCapture)
+            , eventListenerWrapper(eventListenerWrapper)
+            , node(node)
+        {
+        }
+
+        WebString eventType;
+        bool useCapture;
+        DeprecatedEventListenerWrapper* eventListenerWrapper;
+        Node* node;
+    };
+
+private:
+    WebEventListener* m_webEventListener;
+
+    // We keep a list of the wrapper for the WebKit EventListener, it is needed
+    // to implement WebNode::removeEventListener().
+    Vector<ListenerInfo> m_listenerWrappers;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebNode.cpp b/WebKit/chromium/src/WebNode.cpp
index 69c35e7..17140f2 100644
--- a/WebKit/chromium/src/WebNode.cpp
+++ b/WebKit/chromium/src/WebNode.cpp
@@ -38,6 +38,8 @@
 #include "NodeList.h"
 
 #include "EventListenerWrapper.h"
+#include "WebDOMEvent.h"
+#include "WebDOMEventListener.h"
 #include "WebDocument.h"
 #include "WebEvent.h"
 #include "WebEventListener.h"
@@ -149,7 +151,7 @@ bool WebNode::isElementNode() const
     return m_private->isElementNode();
 }
 
-void WebNode::addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
+void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
 {
     EventListenerWrapper* listenerWrapper =
         listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
@@ -159,7 +161,7 @@ void WebNode::addEventListener(const WebString& eventType, WebEventListener* lis
     m_private->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
 }
 
-void WebNode::removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
+void WebNode::removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
 {
     EventListenerWrapper* listenerWrapper =
         listener->getEventListenerWrapper(eventType, useCapture, m_private.get());
@@ -167,6 +169,24 @@ void WebNode::removeEventListener(const WebString& eventType, WebEventListener*
     // listenerWrapper is now deleted.
 }
 
+void WebNode::addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
+{
+    DeprecatedEventListenerWrapper* listenerWrapper =
+        listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
+    // The listenerWrapper is only referenced by the actual Node.  Once it goes
+    // away, the wrapper notifies the WebEventListener so it can clear its
+    // pointer to it.
+    m_private->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
+}
+
+void WebNode::removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture)
+{
+    DeprecatedEventListenerWrapper* listenerWrapper =
+        listener->getEventListenerWrapper(eventType, useCapture, m_private.get());
+    m_private->removeEventListener(eventType, listenerWrapper, useCapture);
+    // listenerWrapper is now deleted.
+}
+
 void WebNode::simulateClick()
 {
     RefPtr<Event> noEvent;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list