[Webkit-unassigned] [Bug 77835] [GObject bindings] Missing scope annotations for add/remove_event_listener

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 20 11:50:27 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=77835





--- Comment #21 from C Anthony <anthony at xtfx.me>  2012-02-20 11:50:27 PST ---
Created an attachment (id=127839)
 --> (https://bugs.webkit.org/attachment.cgi?id=127839&action=review)
[hastily] implements add/remove_event_handler in a binding friendly manner, breaks current API

note: against 1.6.3, i will update my tree if need be ... probably still applies
note: used EventHandler for now -- EventListener triggers generation from IDL file (see below)

this is a working patch, but incomplete (leaks/etc).  however i wanted to post it now to be sure i'm moving in the right direction (i'm slow, this took forever :-).

break current API, but IMO, API is wrong -- handleEvent isnt suppose to take 3 params (DOMNode,DOMEvent/userData), it's only suppose to take one: DOMEvent. the original DOMNode/sender is already available on the DOMEvent object as the `target` or `src_element` property.

i think i can come up with a way to maintain current API, but also support the old, by using some form of _full, or similar, but internally the GObjectEventListener would need to convert ... is this worth it?

also, as stated above, DOMEventListener triggers the generation of WebKitDOMEventListener.(h|cpp) from the corresponding IDL file ... however, looking it over, it *almost* looks correct.  it looks like it might be possible to tweak CodeGenerator to make WebKitDOMEventListener wrap *WebCore::GObjectEventListener* objects instead (basically adding `GObject` in the right places)

i really want to allow a single Listener object to be assigned to unlimited Target objects -- this is both efficient and useful.  i can then add a method to "exchange" the callback contained by the Listener with a new one ... this lets you add listener objects to targets, and change the callback for all of them in one shot, something like:

WEBKIT_DOM_EVENT_HANDLER(m_handler)->handle_event(gobjectEvent)

... where handle_event is the actual callback passed during Listener creation, or updated at anytime.

thoughts?  in a bit of a hurry, apologies if somewhat incomplete ...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list