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

dglazkov at chromium.org dglazkov at chromium.org
Thu Oct 29 20:36:09 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 99cd5c0a9f541f29153e41d44213cc4fb9c50009
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 29 18:51:22 2009 +0000

    2009-09-29  Dimitri Glazkov  <dglazkov at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [V8] Correct an issue with XMLHttpRequest attribute event listeners never being cleared.
            https://bugs.webkit.org/show_bug.cgi?id=29888
    
            Test: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldDispatchEvent.html
    
            * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
            (WebCore::getEventListener): Added isAttribute parameter.
            (WebCore::ACCESSOR_SETTER): Made all event listener setters create attribute listeners.
            (WebCore::CALLBACK_FUNC_DECL): Made addEventListener create object listener.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9d802be..0f4acb3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-29  Dimitri Glazkov  <dglazkov at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [V8] Correct an issue with XMLHttpRequest attribute event listeners never being cleared.
+        https://bugs.webkit.org/show_bug.cgi?id=29888
+
+        Test: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldDispatchEvent.html
+
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::getEventListener): Added isAttribute parameter.
+        (WebCore::ACCESSOR_SETTER): Made all event listener setters create attribute listeners.
+        (WebCore::CALLBACK_FUNC_DECL): Made addEventListener create object listener.
+
 2009-09-22  Martin Robinson  <martin.james.robinson at gmail.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 8f2366b..46c7a7f 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -45,18 +45,21 @@
 
 namespace WebCore {
 
-static PassRefPtr<EventListener> getEventListener(XMLHttpRequest* xmlHttpRequest, v8::Local<v8::Value> value, bool findOnly)
+enum EventListenerType { AttributeEventListenerType, ObjectEventListenerType };
+
+static PassRefPtr<EventListener> getEventListener(XMLHttpRequest* xmlHttpRequest, v8::Local<v8::Value> value, EventListenerType type, bool findOnly)
 {
+    bool isAttribute = type == AttributeEventListenerType;
 #if ENABLE(WORKERS)
     WorkerContextExecutionProxy* workerContextProxy = WorkerContextExecutionProxy::retrieve();
     if (workerContextProxy)
-        return workerContextProxy->findOrCreateObjectEventListener(value, false, findOnly);
+        return workerContextProxy->findOrCreateObjectEventListener(value, isAttribute, findOnly);
 #endif
 
     V8Proxy* proxy = V8Proxy::retrieve(xmlHttpRequest->scriptExecutionContext());
     if (proxy) {
         V8EventListenerList* list = proxy->objectListeners();
-        return findOnly ? list->findWrapper(value, false) : list->findOrCreateWrapper<V8ObjectEventListener>(proxy->frame(), value, false);
+        return findOnly ? list->findWrapper(value, isAttribute) : list->findOrCreateWrapper<V8ObjectEventListener>(proxy->frame(), value, isAttribute);
     }
 
     return PassRefPtr<EventListener>();
@@ -88,7 +91,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnabort)
         // Clear the listener.
         xmlHttpRequest->setOnabort(0);
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnabort(listener);
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -122,7 +125,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnerror)
         // Clear the listener.
         xmlHttpRequest->setOnerror(0);
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnerror(listener);
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -156,7 +159,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnload)
         xmlHttpRequest->setOnload(0);
 
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnload(listener.get());
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -190,7 +193,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnloadstart)
         // Clear the listener.
         xmlHttpRequest->setOnloadstart(0);
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnloadstart(listener);
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -224,7 +227,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnprogress)
         // Clear the listener.
         xmlHttpRequest->setOnprogress(0);
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnprogress(listener);
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -258,7 +261,7 @@ ACCESSOR_SETTER(XMLHttpRequestOnreadystatechange)
         // Clear the listener.
         xmlHttpRequest->setOnreadystatechange(0);
     } else {
-        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, false);
+        RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, value, AttributeEventListenerType, false);
         if (listener) {
             xmlHttpRequest->setOnreadystatechange(listener.get());
             createHiddenDependency(info.Holder(), value, V8Custom::kXMLHttpRequestCacheIndex);
@@ -280,7 +283,7 @@ CALLBACK_FUNC_DECL(XMLHttpRequestAddEventListener)
     INC_STATS("DOM.XMLHttpRequest.addEventListener()");
     XMLHttpRequest* xmlHttpRequest = V8DOMWrapper::convertToNativeObject<XMLHttpRequest>(V8ClassIndex::XMLHTTPREQUEST, args.Holder());
 
-    RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, args[1], false);
+    RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, args[1], ObjectEventListenerType, false);
     if (listener) {
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();
@@ -296,7 +299,7 @@ CALLBACK_FUNC_DECL(XMLHttpRequestRemoveEventListener)
     INC_STATS("DOM.XMLHttpRequest.removeEventListener()");
     XMLHttpRequest* xmlHttpRequest = V8DOMWrapper::convertToNativeObject<XMLHttpRequest>(V8ClassIndex::XMLHTTPREQUEST, args.Holder());
 
-    RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, args[1], true);
+    RefPtr<EventListener> listener = getEventListener(xmlHttpRequest, args[1], ObjectEventListenerType, true);
     if (listener) {
         String type = toWebCoreString(args[0]);
         bool useCapture = args[2]->BooleanValue();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list