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)
commit4204f517a507e8df0d048262afb9221e01b1001d
treecae8e8e9f35a2ac94b93562f70113c59833a693c
parenta950fb941a8b06257fdb44a5aff2771ee41c96ab
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:

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