[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:33:34 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit e57df819e97bce5e3c1dbc7bd2da086f1d884410
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 24 14:11:32 2009 +0000

    2009-09-24  Vitaly Repeshko  <vitalyr at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            [V8] Fixed bindings build after http://trac.webkit.org/changeset/48701
            https://bugs.webkit.org/show_bug.cgi?id=29713
    
            Got rid of isWindowEvent in function signatures:
            * bindings/v8/V8AbstractEventListener.cpp:
            (WebCore::V8AbstractEventListener::invokeEventHandler):
            (WebCore::V8AbstractEventListener::handleEvent):
            (WebCore::V8AbstractEventListener::getReceiverObject):
            * bindings/v8/V8AbstractEventListener.h:
            * bindings/v8/V8LazyEventListener.cpp:
            (WebCore::V8LazyEventListener::callListenerFunction):
            * bindings/v8/V8LazyEventListener.h:
            * bindings/v8/V8WorkerContextEventListener.cpp:
            (WebCore::V8WorkerContextEventListener::handleEvent):
            (WebCore::V8WorkerContextEventListener::callListenerFunction):
            (WebCore::V8WorkerContextEventListener::getReceiverObject):
            * bindings/v8/V8WorkerContextEventListener.h:
            * bindings/v8/custom/V8CustomEventListener.cpp:
            (WebCore::V8EventListener::callListenerFunction):
            * bindings/v8/custom/V8CustomEventListener.h:
    
            Switched to EventTarget methods of adding/removing listeners:
            * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
            (WebCore::toEventID):
            (WebCore::ACCESSOR_SETTER):
    
            * dom/EventTarget.h: Some functions were incorrectly marked
            as JSC-specific.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48720 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 67548bc..910dcec 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2009-09-24  Vitaly Repeshko  <vitalyr at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [V8] Fixed bindings build after http://trac.webkit.org/changeset/48701
+        https://bugs.webkit.org/show_bug.cgi?id=29713
+
+        Got rid of isWindowEvent in function signatures:
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::invokeEventHandler):
+        (WebCore::V8AbstractEventListener::handleEvent):
+        (WebCore::V8AbstractEventListener::getReceiverObject):
+        * bindings/v8/V8AbstractEventListener.h:
+        * bindings/v8/V8LazyEventListener.cpp:
+        (WebCore::V8LazyEventListener::callListenerFunction):
+        * bindings/v8/V8LazyEventListener.h:
+        * bindings/v8/V8WorkerContextEventListener.cpp:
+        (WebCore::V8WorkerContextEventListener::handleEvent):
+        (WebCore::V8WorkerContextEventListener::callListenerFunction):
+        (WebCore::V8WorkerContextEventListener::getReceiverObject):
+        * bindings/v8/V8WorkerContextEventListener.h:
+        * bindings/v8/custom/V8CustomEventListener.cpp:
+        (WebCore::V8EventListener::callListenerFunction):
+        * bindings/v8/custom/V8CustomEventListener.h:
+
+        Switched to EventTarget methods of adding/removing listeners:
+        * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
+        (WebCore::toEventID):
+        (WebCore::ACCESSOR_SETTER):
+
+        * dom/EventTarget.h: Some functions were incorrectly marked
+        as JSC-specific.
+
 2009-09-24  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/bindings/v8/V8AbstractEventListener.cpp b/WebCore/bindings/v8/V8AbstractEventListener.cpp
index 83d7e23..1829e29 100644
--- a/WebCore/bindings/v8/V8AbstractEventListener.cpp
+++ b/WebCore/bindings/v8/V8AbstractEventListener.cpp
@@ -63,7 +63,7 @@ V8AbstractEventListener::V8AbstractEventListener(Frame* frame, bool isAttribute)
     }
 }
 
-void V8AbstractEventListener::invokeEventHandler(v8::Handle<v8::Context> v8Context, Event* event, v8::Handle<v8::Value> jsEvent, bool isWindowEvent)
+void V8AbstractEventListener::invokeEventHandler(v8::Handle<v8::Context> v8Context, Event* event, v8::Handle<v8::Value> jsEvent)
 {
     // We push the event being processed into the global object, so that it can be exposed by DOMWindow's bindings.
     v8::Local<v8::String> eventSymbol = v8::String::NewSymbol("event");
@@ -88,7 +88,7 @@ void V8AbstractEventListener::invokeEventHandler(v8::Handle<v8::Context> v8Conte
 
         // Call the event handler.
         tryCatch.SetVerbose(false); // We do not want to report the exception to the inspector console.
-        returnValue = callListenerFunction(jsEvent, event, isWindowEvent);
+        returnValue = callListenerFunction(jsEvent, event);
         if (!tryCatch.CanContinue())
             return;
 
@@ -124,7 +124,7 @@ void V8AbstractEventListener::invokeEventHandler(v8::Handle<v8::Context> v8Conte
         event->preventDefault();
 }
 
-void V8AbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
+void V8AbstractEventListener::handleEvent(Event* event)
 {
     // EventListener could be disconnected from the frame.
     if (disconnected())
@@ -154,7 +154,7 @@ void V8AbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
     // Get the V8 wrapper for the event object.
     v8::Handle<v8::Value> jsEvent = V8DOMWrapper::convertEventToV8Object(event);
 
-    invokeEventHandler(v8Context, event, jsEvent, isWindowEvent);
+    invokeEventHandler(v8Context, event, jsEvent);
 
     Document::updateStyleForAllDocuments();
 }
@@ -170,14 +170,11 @@ void V8AbstractEventListener::disposeListenerObject()
     }
 }
 
-v8::Local<v8::Object> V8AbstractEventListener::getReceiverObject(Event* event, bool isWindowEvent)
+v8::Local<v8::Object> V8AbstractEventListener::getReceiverObject(Event* event)
 {
     if (!m_listener.IsEmpty() && !m_listener->IsFunction())
         return v8::Local<v8::Object>::New(m_listener);
 
-    if (isWindowEvent)
-        return v8::Context::GetCurrent()->Global();
-
     EventTarget* target = event->currentTarget();
     v8::Handle<v8::Value> value = V8DOMWrapper::convertEventTargetToV8Object(target);
     if (value.IsEmpty())
diff --git a/WebCore/bindings/v8/V8AbstractEventListener.h b/WebCore/bindings/v8/V8AbstractEventListener.h
index 284c970..789cf04 100644
--- a/WebCore/bindings/v8/V8AbstractEventListener.h
+++ b/WebCore/bindings/v8/V8AbstractEventListener.h
@@ -58,8 +58,8 @@ namespace WebCore {
         // Returns the owner frame of the listener.
         Frame* frame() { return m_frame; }
 
-        virtual void handleEvent(Event*, bool isWindowEvent);
-        void invokeEventHandler(v8::Handle<v8::Context>, Event*, v8::Handle<v8::Value> jsEvent, bool isWindowEvent);
+        virtual void handleEvent(Event*);
+        void invokeEventHandler(v8::Handle<v8::Context>, Event*, v8::Handle<v8::Value> jsEvent);
 
         // Returns the listener object, either a function or an object.
         virtual v8::Local<v8::Object> getListenerObject()
@@ -83,10 +83,10 @@ namespace WebCore {
     private:
         V8AbstractEventListener(Frame*, bool isInline);
 
-        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsevent, Event*, bool isWindowEvent) = 0;
+        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsevent, Event*) = 0;
 
         // Get the receiver object to use for event listener call.
-        v8::Local<v8::Object> getReceiverObject(Event*, bool isWindowEvent);
+        v8::Local<v8::Object> getReceiverObject(Event*);
 
         // Frame to which the event listener is attached to. An event listener must be destroyed before its owner frame is
         // deleted. See fast/dom/replaceChild.html
diff --git a/WebCore/bindings/v8/V8LazyEventListener.cpp b/WebCore/bindings/v8/V8LazyEventListener.cpp
index 59fa7be..ccf32a7 100644
--- a/WebCore/bindings/v8/V8LazyEventListener.cpp
+++ b/WebCore/bindings/v8/V8LazyEventListener.cpp
@@ -124,10 +124,10 @@ v8::Local<v8::Function> V8LazyEventListener::getListenerFunction()
     return m_listener.IsEmpty() ? v8::Local<v8::Function>() : v8::Local<v8::Function>::New(v8::Persistent<v8::Function>::Cast(m_listener));
 }
 
-v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event, bool isWindowEvent)
+v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
 {
     v8::Local<v8::Function> handlerFunction = getWrappedListenerFunction();
-    v8::Local<v8::Object> receiver = getReceiverObject(event, isWindowEvent);
+    v8::Local<v8::Object> receiver = getReceiverObject(event);
     if (handlerFunction.IsEmpty() || receiver.IsEmpty())
         return v8::Local<v8::Value>();
 
diff --git a/WebCore/bindings/v8/V8LazyEventListener.h b/WebCore/bindings/v8/V8LazyEventListener.h
index 62d9342..c9f6a84 100644
--- a/WebCore/bindings/v8/V8LazyEventListener.h
+++ b/WebCore/bindings/v8/V8LazyEventListener.h
@@ -71,7 +71,7 @@ namespace WebCore {
 
         v8::Local<v8::Function> getWrappedListenerFunction();
 
-        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*, bool isWindowEvent);
+        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*);
 
         v8::Local<v8::Function> getListenerFunction();
     };
diff --git a/WebCore/bindings/v8/V8WorkerContextEventListener.cpp b/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
index 3d28017..bde60a1 100644
--- a/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
+++ b/WebCore/bindings/v8/V8WorkerContextEventListener.cpp
@@ -53,7 +53,7 @@ V8WorkerContextEventListener::~V8WorkerContextEventListener()
     disposeListenerObject();
 }
 
-void V8WorkerContextEventListener::handleEvent(Event* event, bool isWindowEvent)
+void V8WorkerContextEventListener::handleEvent(Event* event)
 {
     // Is the EventListener disconnected?
     if (disconnected())
@@ -75,7 +75,7 @@ void V8WorkerContextEventListener::handleEvent(Event* event, bool isWindowEvent)
     // Get the V8 wrapper for the event object.
     v8::Handle<v8::Value> jsEvent = WorkerContextExecutionProxy::convertEventToV8Object(event);
 
-    invokeEventHandler(context, event, jsEvent, isWindowEvent);
+    invokeEventHandler(context, event, jsEvent);
 }
 
 bool V8WorkerContextEventListener::reportError(const String& message, const String& url, int lineNumber)
@@ -124,10 +124,10 @@ bool V8WorkerContextEventListener::reportError(const String& message, const Stri
     return errorHandled;
 }
 
-v8::Local<v8::Value> V8WorkerContextEventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event, bool isWindowEvent)
+v8::Local<v8::Value> V8WorkerContextEventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
 {
     v8::Local<v8::Function> handlerFunction = getListenerFunction();
-    v8::Local<v8::Object> receiver = getReceiverObject(event, isWindowEvent);
+    v8::Local<v8::Object> receiver = getReceiverObject(event);
     if (handlerFunction.IsEmpty() || receiver.IsEmpty())
         return v8::Local<v8::Value>();
 
@@ -139,14 +139,11 @@ v8::Local<v8::Value> V8WorkerContextEventListener::callListenerFunction(v8::Hand
     return result;
 }
 
-v8::Local<v8::Object> V8WorkerContextEventListener::getReceiverObject(Event* event, bool isWindowEvent)
+v8::Local<v8::Object> V8WorkerContextEventListener::getReceiverObject(Event* event)
 {
     if (!m_listener.IsEmpty() && !m_listener->IsFunction())
         return v8::Local<v8::Object>::New(m_listener);
 
-    if (isWindowEvent)
-        return v8::Context::GetCurrent()->Global();
-
     EventTarget* target = event->currentTarget();
     v8::Handle<v8::Value> value = WorkerContextExecutionProxy::convertEventTargetToV8Object(target);
     if (value.IsEmpty())
diff --git a/WebCore/bindings/v8/V8WorkerContextEventListener.h b/WebCore/bindings/v8/V8WorkerContextEventListener.h
index c901c51..943ae76 100644
--- a/WebCore/bindings/v8/V8WorkerContextEventListener.h
+++ b/WebCore/bindings/v8/V8WorkerContextEventListener.h
@@ -51,7 +51,7 @@ namespace WebCore {
         V8WorkerContextEventListener(WorkerContextExecutionProxy*, v8::Local<v8::Object> listener, bool isInline);
 
         virtual ~V8WorkerContextEventListener();
-        virtual void handleEvent(Event*, bool isWindowEvent);
+        virtual void handleEvent(Event*);
         virtual bool reportError(const String& message, const String& url, int lineNumber);
         virtual bool disconnected() const { return !m_proxy; }
 
@@ -59,8 +59,8 @@ namespace WebCore {
         void disconnect() { m_proxy = 0; }
 
     private:
-        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*, bool isWindowEvent);
-        v8::Local<v8::Object> getReceiverObject(Event*, bool isWindowEvent);
+        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*);
+        v8::Local<v8::Object> getReceiverObject(Event*);
         WorkerContextExecutionProxy* m_proxy;
     };
 
diff --git a/WebCore/bindings/v8/custom/V8CustomEventListener.cpp b/WebCore/bindings/v8/custom/V8CustomEventListener.cpp
index 305da8d..b11c496 100644
--- a/WebCore/bindings/v8/custom/V8CustomEventListener.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomEventListener.cpp
@@ -73,10 +73,10 @@ v8::Local<v8::Function> V8EventListener::getListenerFunction()
     return v8::Local<v8::Function>();
 }
 
-v8::Local<v8::Value> V8EventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event, bool isWindowEvent)
+v8::Local<v8::Value> V8EventListener::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
 {
     v8::Local<v8::Function> handlerFunction = getListenerFunction();
-    v8::Local<v8::Object> receiver = getReceiverObject(event, isWindowEvent);
+    v8::Local<v8::Object> receiver = getReceiverObject(event);
     if (handlerFunction.IsEmpty() || receiver.IsEmpty())
         return v8::Local<v8::Value>();
 
diff --git a/WebCore/bindings/v8/custom/V8CustomEventListener.h b/WebCore/bindings/v8/custom/V8CustomEventListener.h
index 20adf99..93ad8fb 100644
--- a/WebCore/bindings/v8/custom/V8CustomEventListener.h
+++ b/WebCore/bindings/v8/custom/V8CustomEventListener.h
@@ -58,7 +58,7 @@ namespace WebCore {
         v8::Local<v8::Function> getListenerFunction();
 
     private:
-        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*, bool isWindowEvent);
+        virtual v8::Local<v8::Value> callListenerFunction(v8::Handle<v8::Value> jsEvent, Event*);
         virtual bool virtualisAttribute() const { return m_isAttribute; }
     };
 
diff --git a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
index ad20a56..63fc698 100644
--- a/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMApplicationCacheCustom.cpp
@@ -61,11 +61,11 @@ static v8::Local<v8::Object> eventListenerToV8Object(EventListener* listener)
     return (static_cast<V8ObjectEventListener*>(listener))->getListenerObject();
 }
 
-static inline ApplicationCacheHost::EventID toEventID(v8::Local<v8::String> value)
+static inline String toEventID(v8::Local<v8::String> value)
 {
     String key = toWebCoreString(value);
     ASSERT(key.startsWith("on"));
-    return DOMApplicationCache::toEventID(key.substring(2));
+    return key.substring(2);
 }
 
 // Handles appcache.onfooevent attribute getting
@@ -83,7 +83,7 @@ ACCESSOR_SETTER(DOMApplicationCacheEventHandler)
 {
     INC_STATS("DOMApplicationCache.onevent_setter");
     DOMApplicationCache* appcache = V8DOMWrapper::convertToNativeObject<DOMApplicationCache>(V8ClassIndex::DOMAPPLICATIONCACHE, info.Holder());
-    ApplicationCacheHost::EventID eventType = toEventID(name);
+    String eventType = toEventID(name);
 
     if (EventListener* oldListener = appcache->getAttributeEventListener(eventType)) {
         v8::Local<v8::Object> object = eventListenerToV8Object(oldListener);
diff --git a/WebCore/dom/EventTarget.h b/WebCore/dom/EventTarget.h
index 4499328..2d612e1 100644
--- a/WebCore/dom/EventTarget.h
+++ b/WebCore/dom/EventTarget.h
@@ -202,6 +202,7 @@ namespace WebCore {
 
         d->eventListenerMap.clear();
     }
+#endif
 
     inline bool EventTarget::isFiringEventListeners()
     {
@@ -227,8 +228,6 @@ namespace WebCore {
         return d->eventListenerMap.contains(eventType);
     }
 
-#endif
-
 } // namespace WebCore
 
 #endif // EventTarget_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list