2010-04-27 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 20:26:16 +0000 (20:26 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 20:26:16 +0000 (20:26 +0000)
        Reviewed by Darin Adler.

        Remove copy/paste addEventListener "custom" bindings via code generation
        https://bugs.webkit.org/show_bug.cgi?id=38210

        It's somewhat lame to special case addEventListener and
        removeEventListener in the code generator, but it saves a large amount
        of boilerplate "custom" bindings code.

        Idea shamelessly stolen from the V8 code generator.

        This patch points to some good refactoring opportunities in
        CodeGeneratorJS.pm, but I'm going to hold off on those for a future
        patch.  By generating test coverage for the code generator, we make
        these future refactorings easier.

        * bindings/js/JSAbstractWorkerCustom.cpp:
        * bindings/js/JSDOMApplicationCacheCustom.cpp:
        * bindings/js/JSDesktopNotificationsCustom.cpp:
        * bindings/js/JSEventSourceCustom.cpp:
        * bindings/js/JSMessagePortCustom.cpp:
        * bindings/js/JSNodeCustom.cpp:
        * bindings/js/JSSVGElementInstanceCustom.cpp:
        * bindings/js/JSWebSocketCustom.cpp:
        * bindings/js/JSWorkerContextCustom.cpp:
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::):
        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/ObjC/DOMTestObj.h:
        * bindings/scripts/test/ObjC/DOMTestObj.mm:
        (-[DOMTestObj addEventListener:listener:useCapture:]):
        (-[DOMTestObj removeEventListener:listener:useCapture:]):
        * bindings/scripts/test/TestObj.idl:
        * bindings/scripts/test/V8/V8TestObj.cpp:
        (WebCore::TestObjInternal::addEventListenerCallback):
        (WebCore::TestObjInternal::removeEventListenerCallback):
        (WebCore::):
        * dom/MessagePort.idl:
        * dom/Node.idl:
        * loader/appcache/DOMApplicationCache.idl:
        * notifications/Notification.idl:
        * page/EventSource.idl:
        * svg/SVGElementInstance.idl:
        * websockets/WebSocket.idl:
        * workers/AbstractWorker.idl:
        * workers/WorkerContext.idl:
        * xml/XMLHttpRequest.idl:
        * xml/XMLHttpRequestUpload.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
WebCore/ChangeLog
WebCore/bindings/js/JSAbstractWorkerCustom.cpp
WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
WebCore/bindings/js/JSDesktopNotificationsCustom.cpp
WebCore/bindings/js/JSEventSourceCustom.cpp
WebCore/bindings/js/JSMessagePortCustom.cpp
WebCore/bindings/js/JSNodeCustom.cpp
WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
WebCore/bindings/js/JSWebSocketCustom.cpp
WebCore/bindings/js/JSWorkerContextCustom.cpp
WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
WebCore/bindings/scripts/test/JS/JSTestObj.cpp
WebCore/bindings/scripts/test/JS/JSTestObj.h
WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
WebCore/bindings/scripts/test/TestObj.idl
WebCore/bindings/scripts/test/V8/V8TestObj.cpp
WebCore/dom/MessagePort.idl
WebCore/dom/Node.idl
WebCore/loader/appcache/DOMApplicationCache.idl
WebCore/notifications/Notification.idl
WebCore/page/EventSource.idl
WebCore/svg/SVGElementInstance.idl
WebCore/websockets/WebSocket.idl
WebCore/workers/AbstractWorker.idl
WebCore/workers/WorkerContext.idl
WebCore/xml/XMLHttpRequest.idl
WebCore/xml/XMLHttpRequestUpload.idl

index 979871a..afc5f42 100644 (file)
@@ -1,3 +1,61 @@
+2010-04-27  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Remove copy/paste addEventListener "custom" bindings via code generation
+        https://bugs.webkit.org/show_bug.cgi?id=38210
+
+        It's somewhat lame to special case addEventListener and
+        removeEventListener in the code generator, but it saves a large amount
+        of boilerplate "custom" bindings code.
+
+        Idea shamelessly stolen from the V8 code generator.
+
+        This patch points to some good refactoring opportunities in
+        CodeGeneratorJS.pm, but I'm going to hold off on those for a future
+        patch.  By generating test coverage for the code generator, we make
+        these future refactorings easier.
+
+        * bindings/js/JSAbstractWorkerCustom.cpp:
+        * bindings/js/JSDOMApplicationCacheCustom.cpp:
+        * bindings/js/JSDesktopNotificationsCustom.cpp:
+        * bindings/js/JSEventSourceCustom.cpp:
+        * bindings/js/JSMessagePortCustom.cpp:
+        * bindings/js/JSNodeCustom.cpp:
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        * bindings/js/JSWebSocketCustom.cpp:
+        * bindings/js/JSWorkerContextCustom.cpp:
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::):
+        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
+        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        (-[DOMTestObj addEventListener:listener:useCapture:]):
+        (-[DOMTestObj removeEventListener:listener:useCapture:]):
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjInternal::addEventListenerCallback):
+        (WebCore::TestObjInternal::removeEventListenerCallback):
+        (WebCore::):
+        * dom/MessagePort.idl:
+        * dom/Node.idl:
+        * loader/appcache/DOMApplicationCache.idl:
+        * notifications/Notification.idl:
+        * page/EventSource.idl:
+        * svg/SVGElementInstance.idl:
+        * websockets/WebSocket.idl:
+        * workers/AbstractWorker.idl:
+        * workers/WorkerContext.idl:
+        * xml/XMLHttpRequest.idl:
+        * xml/XMLHttpRequestUpload.idl:
+
 2010-04-27  Sam Weinig  <sam@webkit.org>
 
         Rubber-stamped by Beth Dakin.
index 1f843f9..d5910e4 100644 (file)
@@ -44,25 +44,7 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSAbstractWorker::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSAbstractWorker::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
+// FIXME: Remove this file.
 
 } // namespace WebCore
 
index 6198d6e..b1f82a8 100644 (file)
@@ -85,26 +85,6 @@ JSValue JSDOMApplicationCache::remove(ExecState* exec, const ArgList& args)
 
 #endif // ENABLE(APPLICATION_CACHE_DYNAMIC_ENTRIES)
 
-JSValue JSDOMApplicationCache::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSDOMApplicationCache::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(OFFLINE_WEB_APPLICATIONS)
index f86bae5..387f5f5 100644 (file)
@@ -61,27 +61,6 @@ JSValue JSNotificationCenter::requestPermission(ExecState* exec, const ArgList&
     return jsUndefined();
 }
 
-JSValue JSNotification::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSNotification::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-
 } // namespace
 
 #endif // ENABLE(NOTIFICATIONS)
index 86db431..e0bc69c 100644 (file)
@@ -43,25 +43,7 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSEventSource::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSEventSource::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
+// FIXME: Remove this file.
 
 } // namespace WebCore
 
index f7c0160..4c1491d 100644 (file)
@@ -52,26 +52,6 @@ void JSMessagePort::markChildren(MarkStack& markStack)
     m_impl->markJSEventListeners(markStack);
 }
 
-JSValue JSMessagePort::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSMessagePort::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec, const JSC::ArgList& args)
 {
     return handlePostMessage(exec, args, impl());
index 3a07b29..9fbcffd 100644 (file)
@@ -169,26 +169,6 @@ JSValue JSNode::appendChild(ExecState* exec, const ArgList& args)
     return jsNull();
 }
 
-JSValue JSNode::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSNode::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 void JSNode::pushEventHandlerScope(ExecState*, ScopeChain&) const
 {
 }
index fdcab06..ccf5ccd 100644 (file)
@@ -46,26 +46,6 @@ void JSSVGElementInstance::markChildren(MarkStack& markStack)
     markDOMNodeWrapper(markStack, impl()->correspondingElement()->document(), impl()->correspondingElement());
 }
 
-JSValue JSSVGElementInstance::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSSVGElementInstance::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 void JSSVGElementInstance::pushEventHandlerScope(ExecState*, ScopeChain&) const
 {
 }
index 18f4183..149ac5d 100644 (file)
@@ -59,26 +59,6 @@ JSValue JSWebSocket::send(ExecState* exec, const ArgList& args)
     return ret;
 }
 
-JSValue JSWebSocket::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSWebSocket::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 }  // namespace WebCore
 
 #endif
index 0a9489b..a70c1b3 100644 (file)
@@ -116,26 +116,6 @@ JSValue JSWorkerContext::importScripts(ExecState* exec, const ArgList& args)
     return jsUndefined();
 }
 
-JSValue JSWorkerContext::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSWorkerContext::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 JSValue JSWorkerContext::setTimeout(ExecState* exec, const ArgList& args)
 {
     OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, args, currentWorld(exec));
index da83801..fc72154 100644 (file)
@@ -153,26 +153,6 @@ JSValue JSXMLHttpRequest::overrideMimeType(ExecState* exec, const ArgList& args)
     return jsUndefined();
 }
 
-JSValue JSXMLHttpRequest::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSXMLHttpRequest::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 JSValue JSXMLHttpRequest::responseText(ExecState* exec) const
 {
     return jsOwnedStringOrNull(exec, impl()->responseText());
index 42d4eb9..091c380 100644 (file)
@@ -51,24 +51,4 @@ void JSXMLHttpRequestUpload::markChildren(MarkStack& markStack)
     m_impl->markJSEventListeners(markStack);
 }
 
-JSValue JSXMLHttpRequestUpload::addEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
-JSValue JSXMLHttpRequestUpload::removeEventListener(ExecState* exec, const ArgList& args)
-{
-    JSValue listener = args.at(1);
-    if (!listener.isObject())
-        return jsUndefined();
-
-    impl()->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
-    return jsUndefined();
-}
-
 } // namespace WebCore
index c75f5d6..41634b2 100644 (file)
@@ -121,6 +121,25 @@ sub GenerateInterface
     }
 }
 
+sub GenerateEventListenerCall
+{
+    my $className = shift;
+    my $functionName = shift;
+    my $passRefPtrHandling = ($functionName eq "add") ? "" : ".get()";
+
+    $implIncludes{"JSEventListener.h"} = 1;
+
+    my @GenerateEventListenerImpl = ();
+    push(@GenerateEventListenerImpl, <<END);
+    JSValue listener = args.at(1);
+    if (!listener.isObject())
+        return jsUndefined();
+    imp->${functionName}EventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), castedThisObj, false, currentWorld(exec))$passRefPtrHandling, args.at(2).toBoolean(exec));
+    return jsUndefined();
+END
+    return @GenerateEventListenerImpl;
+}
+
 # Params: 'idlDocument' struct
 sub GenerateModule
 {
@@ -1693,88 +1712,94 @@ sub GenerateImplementation
                     $implIncludes{"JSDOMBinding.h"} = 1;
                 }
 
-                my $paramIndex = 0;
-                my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "(";
-
-                my $hasOptionalArguments = 0;
+                if ($function->signature->name eq "addEventListener") {
+                    push(@implContent, GenerateEventListenerCall($className, "add"));
+                } elsif ($function->signature->name eq "removeEventListener") {
+                    push(@implContent, GenerateEventListenerCall($className, "remove"));
+                } else {
+                    my $paramIndex = 0;
+                    my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "(";
 
-                if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
-                    push(@implContent, "    ScriptCallStack callStack(exec, args, $numParameters);\n");
-                    $implIncludes{"ScriptCallStack.h"} = 1;
-                }
+                    my $hasOptionalArguments = 0;
 
-                my $callWith = $function->signature->extendedAttributes->{"CallWith"};
-                if ($callWith) {
-                    my $callWithArg = "COMPILE_ASSERT(false)";
-                    if ($callWith eq "DynamicFrame") {
-                        push(@implContent, "    Frame* dynamicFrame = toDynamicFrame(exec);\n");
-                        push(@implContent, "    if (!dynamicFrame)\n");
-                        push(@implContent, "        return jsUndefined();\n");
-                        $callWithArg = "dynamicFrame";
-                    } elsif ($callWith eq "ScriptState") {
-                        $callWithArg = "exec";
+                    if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
+                        push(@implContent, "    ScriptCallStack callStack(exec, args, $numParameters);\n");
+                        $implIncludes{"ScriptCallStack.h"} = 1;
                     }
-                    $functionString .= ", " if $paramIndex;
-                    $functionString .= $callWithArg;
-                    $paramIndex++;
-                }
 
-                foreach my $parameter (@{$function->parameters}) {
-                    if (!$hasOptionalArguments && $parameter->extendedAttributes->{"Optional"}) {
-                        push(@implContent, "\n    int argsCount = args.size();\n");
-                        $hasOptionalArguments = 1;
+                    my $callWith = $function->signature->extendedAttributes->{"CallWith"};
+                    if ($callWith) {
+                        my $callWithArg = "COMPILE_ASSERT(false)";
+                        if ($callWith eq "DynamicFrame") {
+                            push(@implContent, "    Frame* dynamicFrame = toDynamicFrame(exec);\n");
+                            push(@implContent, "    if (!dynamicFrame)\n");
+                            push(@implContent, "        return jsUndefined();\n");
+                            $callWithArg = "dynamicFrame";
+                        } elsif ($callWith eq "ScriptState") {
+                            $callWithArg = "exec";
+                        }
+                        $functionString .= ", " if $paramIndex;
+                        $functionString .= $callWithArg;
+                        $paramIndex++;
                     }
 
-                    if ($hasOptionalArguments) {
-                        push(@implContent, "    if (argsCount < " . ($paramIndex + 1) . ") {\n");
-                        GenerateImplementationFunctionCall($function, $functionString, $paramIndex, "    " x 2, $podType, $implClassName);
-                        push(@implContent, "    }\n\n");
-                    }
+                    foreach my $parameter (@{$function->parameters}) {
+                        if (!$hasOptionalArguments && $parameter->extendedAttributes->{"Optional"}) {
+                            push(@implContent, "\n    int argsCount = args.size();\n");
+                            $hasOptionalArguments = 1;
+                        }
+
+                        if ($hasOptionalArguments) {
+                            push(@implContent, "    if (argsCount < " . ($paramIndex + 1) . ") {\n");
+                            GenerateImplementationFunctionCall($function, $functionString, $paramIndex, "    " x 2, $podType, $implClassName);
+                            push(@implContent, "    }\n\n");
+                        }
 
-                    my $name = $parameter->name;
+                        my $name = $parameter->name;
                     
-                    if ($parameter->type eq "XPathNSResolver") {
-                        push(@implContent, "    RefPtr<XPathNSResolver> customResolver;\n");
-                        push(@implContent, "    XPathNSResolver* resolver = toXPathNSResolver(args.at($paramIndex));\n");
-                        push(@implContent, "    if (!resolver) {\n");
-                        push(@implContent, "        customResolver = JSCustomXPathNSResolver::create(exec, args.at($paramIndex));\n");
-                        push(@implContent, "        if (exec->hadException())\n");
-                        push(@implContent, "            return jsUndefined();\n");
-                        push(@implContent, "        resolver = customResolver.get();\n");
-                        push(@implContent, "    }\n");
-                    } else {
-                        push(@implContent, "    " . GetNativeTypeFromSignature($parameter) . " $name = " . JSValueToNative($parameter, "args.at($paramIndex)") . ";\n");
-
-                        # If a parameter is "an index" and it's negative it should throw an INDEX_SIZE_ERR exception.
-                        # But this needs to be done in the bindings, because the type is unsigned and the fact that it
-                        # was negative will be lost by the time we're inside the DOM.
-                        if ($parameter->extendedAttributes->{"IsIndex"}) {
-                            $implIncludes{"ExceptionCode.h"} = 1;
-                            push(@implContent, "    if ($name < 0) {\n");
-                            push(@implContent, "        setDOMException(exec, INDEX_SIZE_ERR);\n");
-                            push(@implContent, "        return jsUndefined();\n");
+                        if ($parameter->type eq "XPathNSResolver") {
+                            push(@implContent, "    RefPtr<XPathNSResolver> customResolver;\n");
+                            push(@implContent, "    XPathNSResolver* resolver = toXPathNSResolver(args.at($paramIndex));\n");
+                            push(@implContent, "    if (!resolver) {\n");
+                            push(@implContent, "        customResolver = JSCustomXPathNSResolver::create(exec, args.at($paramIndex));\n");
+                            push(@implContent, "        if (exec->hadException())\n");
+                            push(@implContent, "            return jsUndefined();\n");
+                            push(@implContent, "        resolver = customResolver.get();\n");
                             push(@implContent, "    }\n");
+                        } else {
+                            push(@implContent, "    " . GetNativeTypeFromSignature($parameter) . " $name = " . JSValueToNative($parameter, "args.at($paramIndex)") . ";\n");
+
+                            # If a parameter is "an index" and it's negative it should throw an INDEX_SIZE_ERR exception.
+                            # But this needs to be done in the bindings, because the type is unsigned and the fact that it
+                            # was negative will be lost by the time we're inside the DOM.
+                            if ($parameter->extendedAttributes->{"IsIndex"}) {
+                                $implIncludes{"ExceptionCode.h"} = 1;
+                                push(@implContent, "    if ($name < 0) {\n");
+                                push(@implContent, "        setDOMException(exec, INDEX_SIZE_ERR);\n");
+                                push(@implContent, "        return jsUndefined();\n");
+                                push(@implContent, "    }\n");
+                            }
                         }
-                    }
 
-                    $functionString .= ", " if $paramIndex;
+                        $functionString .= ", " if $paramIndex;
 
-                    if ($parameter->type eq "NodeFilter") {
-                        $functionString .= "$name.get()";
-                    } else {
-                        $functionString .= $name;
+                        if ($parameter->type eq "NodeFilter") {
+                            $functionString .= "$name.get()";
+                        } else {
+                            $functionString .= $name;
+                        }
+                        $paramIndex++;
                     }
-                    $paramIndex++;
-                }
 
-                if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
-                    $functionString .= ", " if $paramIndex;
-                    $functionString .= "processingUserGesture(exec)";
-                    $paramIndex++;
-                }
+                    if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
+                        $functionString .= ", " if $paramIndex;
+                        $functionString .= "processingUserGesture(exec)";
+                        $paramIndex++;
+                    }
 
-                push(@implContent, "\n");
-                GenerateImplementationFunctionCall($function, $functionString, $paramIndex, "    ", $podType, $implClassName);
+                    push(@implContent, "\n");
+                    GenerateImplementationFunctionCall($function, $functionString, $paramIndex, "    ", $podType, $implClassName);
+                }
             }
             push(@implContent, "}\n\n");
         }
index 66e0c2b..6365d9b 100644 (file)
@@ -141,6 +141,12 @@ webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **erro
 
 /* TODO: custom function webkit_dom_test_obj_custom_args_and_exception */
 
+
+/* TODO: event function webkit_dom_test_obj_add_event_listener */
+
+
+/* TODO: event function webkit_dom_test_obj_remove_event_listener */
+
 void
 webkit_dom_test_obj_with_dynamic_frame (WebKitDOMTestObj *self)
 {
index 832497a..1f90d7b 100644 (file)
@@ -70,6 +70,12 @@ webkit_dom_test_obj_method_with_exception (WebKitDOMTestObj *self, GError **erro
 
 /* TODO: custom function webkit_dom_test_obj_custom_args_and_exception */
 
+
+/* TODO: event function webkit_dom_test_obj_add_event_listener */
+
+
+/* TODO: event function webkit_dom_test_obj_remove_event_listener */
+
 WEBKIT_API void
 webkit_dom_test_obj_with_dynamic_frame (WebKitDOMTestObj *self);
 
index f089ca7..da065ca 100644 (file)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "JSTestObj.h"
 
+#include "JSEventListener.h"
 #include "JSTestObj.h"
 #include "JSlog.h"
 #include "KURL.h"
@@ -128,7 +129,7 @@ bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Ident
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestObjPrototypeTableValues[21] =
+static const HashTableValue JSTestObjPrototypeTableValues[23] =
 {
     { "voidMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
     { "voidMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
@@ -140,6 +141,8 @@ static const HashTableValue JSTestObjPrototypeTableValues[21] =
     { "customMethod", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) },
     { "customMethodWithArgs", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
     { "customArgsAndException", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1 THUNK_GENERATOR(0) },
+    { "addEventListener", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
+    { "removeEventListener", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3 THUNK_GENERATOR(0) },
     { "withDynamicFrame", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0 THUNK_GENERATOR(0) },
     { "withDynamicFrameAndArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1 THUNK_GENERATOR(0) },
     { "withDynamicFrameAndOptionalArg", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
@@ -488,6 +491,34 @@ JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(ExecState
     return jsUndefined();
 }
 
+JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
+{
+    UNUSED_PARAM(args);
+    if (!thisValue.inherits(&JSTestObj::s_info))
+        return throwError(exec, TypeError);
+    JSTestObj* castedThisObj = static_cast<JSTestObj*>(asObject(thisValue));
+    TestObj* imp = static_cast<TestObj*>(castedThisObj->impl());
+    JSValue listener = args.at(1);
+    if (!listener.isObject())
+        return jsUndefined();
+    imp->addEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), castedThisObj, false, currentWorld(exec)), args.at(2).toBoolean(exec));
+    return jsUndefined();
+}
+
+JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
+{
+    UNUSED_PARAM(args);
+    if (!thisValue.inherits(&JSTestObj::s_info))
+        return throwError(exec, TypeError);
+    JSTestObj* castedThisObj = static_cast<JSTestObj*>(asObject(thisValue));
+    TestObj* imp = static_cast<TestObj*>(castedThisObj->impl());
+    JSValue listener = args.at(1);
+    if (!listener.isObject())
+        return jsUndefined();
+    imp->removeEventListener(ustringToAtomicString(args.at(0).toString(exec)), JSEventListener::create(asObject(listener), castedThisObj, false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
+    return jsUndefined();
+}
+
 JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 {
     UNUSED_PARAM(args);
index 23bdd3e..b65e86f 100644 (file)
@@ -95,6 +95,8 @@ JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(JSC::Ex
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
+JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
+JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
 JSC::JSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
index 95b6005..ccb8e82 100644 (file)
@@ -31,6 +31,7 @@
 @class DOMTestObj;
 @class DOMlog;
 @class NSString;
+@protocol DOMEventListener;
 
 @interface DOMTestObj : DOMObject
 - (int)readOnlyIntAttr;
@@ -60,6 +61,8 @@
 - (void)customMethod;
 - (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
 - (void)customArgsAndException:(DOMlog *)intArg;
+- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
+- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
 - (void)withDynamicFrame;
 - (void)withDynamicFrameAndArg:(int)intArg;
 - (void)withDynamicFrameAndOptionalArg:(int)intArg optionalArg:(int)optionalArg;
index dc70867..e78538c 100644 (file)
 #import "DOMStyleSheetInternal.h"
 #import "DOMTestObjInternal.h"
 #import "DOMlogInternal.h"
+#import "EventListener.h"
 #import "ExceptionHandlers.h"
 #import "KURL.h"
+#import "ObjCEventListener.h"
 #import "TestObj.h"
 #import "ThreadCheck.h"
 #import "WebCoreObjCExtras.h"
     WebCore::raiseOnDOMError(ec);
 }
 
+- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
+{
+    RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
+    IMPL->addEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+}
+
+- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
+{
+    RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
+    IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+}
+
 - (void)withDynamicFrame
 {
     IMPL->withDynamicFrame();
index eb30e87..8193b29 100644 (file)
@@ -60,6 +60,13 @@ module test {
         [CustomArgumentHandling] void customArgsAndException(in log intArg)
             raises(DOMException);
 
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
+
         // 'CallWith' extended attribute
         [CallWith=DynamicFrame] void withDynamicFrame();
         [CallWith=DynamicFrame] void withDynamicFrameAndArg(in long intArg);
index 961bb50..9b08e5d 100644 (file)
@@ -255,6 +255,28 @@ static v8::Handle<v8::Value> customArgsAndExceptionCallback(const v8::Arguments&
     return v8::Handle<v8::Value>();
 }
 
+static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.addEventListener()");
+    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
+    if (listener) {
+        V8TestObj::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+        createHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
+    }
+    return v8::Undefined();
+}
+
+static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.removeEventListener()");
+    RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
+    if (listener) {
+        V8TestObj::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+        removeHiddenDependency(args.Holder(), args[1], V8TestObj::eventListenerCacheIndex);
+    }
+    return v8::Undefined();
+}
+
 static v8::Handle<v8::Value> withDynamicFrameCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.TestObj.withDynamicFrame");
@@ -482,6 +504,8 @@ static const BatchedCallback TestObjCallbacks[] = {
     {"methodWithException", TestObjInternal::methodWithExceptionCallback},
     {"customMethod", V8TestObj::customMethodCallback},
     {"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
+    {"addEventListener", TestObjInternal::addEventListenerCallback},
+    {"removeEventListener", TestObjInternal::removeEventListenerCallback},
     {"withDynamicFrame", TestObjInternal::withDynamicFrameCallback},
     {"withDynamicFrameAndArg", TestObjInternal::withDynamicFrameAndArgCallback},
     {"withDynamicFrameAndOptionalArg", TestObjInternal::withDynamicFrameAndOptionalArgCallback},
index 9312430..7bde45e 100644 (file)
@@ -43,12 +43,12 @@ module events {
         attribute EventListener onmessage;
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 #endif
index 3af20a0..7bc6d1d 100644 (file)
@@ -134,12 +134,12 @@ module core {
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
 #if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event event)
             raises(EventException);
 #endif
index 9794baf..8525fe6 100644 (file)
@@ -55,12 +55,12 @@ module offline {
         attribute EventListener onobsolete;
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
index b99da96..7f018b7 100644 (file)
@@ -43,12 +43,12 @@ module threads {
         attribute EventListener onclose;
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
index 57bd807..be01098 100644 (file)
@@ -53,12 +53,12 @@ module window {
         void close();
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type,
-                                          in EventListener listener,
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type,
-                                             in EventListener listener,
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type,
+                              in EventListener listener,
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type,
+                                 in EventListener listener,
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 
index d23fea2..3fcadb9 100644 (file)
@@ -90,12 +90,12 @@ module svg {
         attribute [DontEnum] EventListener onsubmit;
         attribute [DontEnum] EventListener onunload;
 
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event event)
             raises(EventException);
 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
index 1707478..cc4a07b 100644 (file)
@@ -57,12 +57,12 @@ module websockets {
         void close();
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type,
-                                          in EventListener listener,
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type,
-                                             in EventListener listener,
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type,
+                              in EventListener listener,
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type,
+                                 in EventListener listener,
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
index 4361dfc..f05ec17 100644 (file)
@@ -38,12 +38,12 @@ module threads {
 
         attribute EventListener onerror;
 
-        [JSCCustom] void addEventListener(in DOMString type,
-                                          in EventListener listener,
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type,
-                                             in EventListener listener,
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type,
+                              in EventListener listener,
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type,
+                                 in EventListener listener,
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
index abb8ea8..ccc2588 100644 (file)
@@ -62,12 +62,12 @@ module threads {
 
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
 
index 5a86fe5..0ca2205 100644 (file)
@@ -91,12 +91,12 @@ module xml {
         [Custom] void overrideMimeType(in DOMString override);
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
index a712a37..5a18567 100644 (file)
@@ -42,12 +42,12 @@ module xml {
         attribute EventListener onprogress;
 
         // EventTarget interface
-        [JSCCustom] void addEventListener(in DOMString type, 
-                                          in EventListener listener, 
-                                          in boolean useCapture);
-        [JSCCustom] void removeEventListener(in DOMString type, 
-                                             in EventListener listener, 
-                                             in boolean useCapture);
+        void addEventListener(in DOMString type, 
+                              in EventListener listener, 
+                              in boolean useCapture);
+        void removeEventListener(in DOMString type, 
+                                 in EventListener listener, 
+                                 in boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };