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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 21 02:46:54 PST 2012


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





--- Comment #23 from C Anthony <anthony at xtfx.me>  2012-02-21 02:46:55 PST ---
cool, i was having the same thoughts ...

... and i'm getting this down pretty well.  i think the solution i'm working on will be the best long term -- i've almost completely eliminated GObjectEventListener (except as the backing WebCore coreObject for EventListener) and there is a good chance of using the IDL/CodeGenerator.

when a GObjectEventListener is destroyed (last remove) it decrefs the corresponding EventListener.  the GNotifyDestroy is not called until the EventListener itself is destroyed (eg, from python/whatever, providing no handles still exist on EventTargets).  if the empty EventListener later tries to rebind to another EventTarget a new GObjectEventListener/coreObject will be dynamically allocated for it.

the GObjectEventListener is essentially only a small proxy now, and it no longer stores the m_target/m_object (EventTargets) because ...

a) the EventTarget is always available on the Event object itself

b) it breaks established semantics from specs and JS (prevents EventListener from binding to multiple EventTargets)

... these changes should allow for unlimited binding and simpler cleanup.

lastly, IMO at least, _create_event_listener() should be on the WebKitDOMDocument, right next to _create_event() ... this can be done in the WebKitDOMCustom files.  two reasons ...

1) non-standard, but looks/feels more natural to me -- people already know _create_event()'s location well

2) in higher languages at least, creating my constructor is currently broken, likely for all objects.  eg, in python, WebKit.DOMEvent() and WebKit.DOMEventListener() result in GObjects with no backing WebCore object, and fails or segfaults when used.  this could possibly be fixed with a late check in _constructor() or maybe _init()

anyways, i'll have a patch up soon enough; hopefully we can kill this bug quickly and i can get back to the actual project that brought me here :-)

-- 
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