RESOLVED FIXED 4247
addEventListener in Obj-C does not work
https://bugs.webkit.org/show_bug.cgi?id=4247
Summary addEventListener in Obj-C does not work
Adriaan Tijsseling
Reported 2005-07-31 22:34:31 PDT
See the thread here: http://lists.apple.com/archives/Webkitsdk-dev/2005/May/msg00050.html In short, adding event listeners via Obj-C has no effect. WebKit doesn't call handleEvent on the target (which conforms to the EventListener protocol).
Attachments
patch to implement this (3.39 KB, patch)
2005-07-31 23:38 PDT, Darin Adler
eric: review+
Darin Adler
Comment 1 2005-07-31 22:35:58 PDT
Uh oh. I see why: - (void)addEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture { ERROR("unimplemented"); } - (void)removeEventListener:(NSString *)type :(id <DOMEventListener>)listener :(BOOL)useCapture { ERROR("unimplemented"); }
Darin Adler
Comment 2 2005-07-31 23:38:42 PDT
Created attachment 3190 [details] patch to implement this
Darin Adler
Comment 3 2005-09-11 11:01:50 PDT
Comment on attachment 3190 [details] patch to implement this Anders said he tried this out and it worked.
Eric Seidel (no email)
Comment 4 2005-09-17 14:33:28 PDT
Comment on attachment 3190 [details] patch to implement this Looks fine. Two comments: 1. I don't understand the ListenerMap map = listenerMap; dance that you do in two places. You had made some comment before about locals being faster to access... but particularly in the ObjCEventListener::find case it seems superfluous. 2. Although I personally agree with the style of returning objects ref-counted... ObjCEventListener::create differs from the rest of the C++ code in WebCore by doing so. I think that wrapper should be returned floating and stuck into a SharedPtr if necessary, or simply returned as a SharedPtr<ObjCEventListener> for consistancy. I'll leave those corrections to your discression. r=me.
Eric Seidel (no email)
Comment 5 2005-09-18 14:44:44 PDT
As ggaren correctly points out, all of these really should have layout tests. For better or worse I ignored that fact, realizing that we don't currently (AFAIK) have any way of testing the Obj-C DOM API. I talked with andersca a bit on IRC, he said he started the py-objc Obj-C DOM testing system, but hasn't finished yet.
Geoffrey Garen
Comment 6 2005-09-20 00:51:51 PDT
OK, since we don't have a way to test the bindings yet, I'm landing this without a test.
Alice Liu
Comment 7 2006-05-30 15:23:31 PDT
Note You need to log in before you can comment on or make changes to this bug.