[Webkit-unassigned] [Bug 77835] [GObject bindings] EventListeners as first-class GObjects: WebKitDOMEventListener

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 23 02:34:35 PDT 2013


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





--- Comment #64 from Carlos Garcia Campos <cgarcia at igalia.com>  2013-10-23 02:33:19 PST ---
(In reply to comment #62)
> (In reply to comment #60)
> > oops, i missed that you found the "Rename to:" annotation, awesome!
> > 
> > if the goal is still to align with DOM spec, we might want to consider fixing the signature of addEventListener, which is (per the spec):
> > 
> > addEventListener(type, listener[, useCapture])
> > 
> > ...vs what we have:
> > 
> > addEventListener(event_name, handler[, bubble])
> > 
> > ...which i believe is actually backward; the third arg in JS is normally `false`, indicating WE WANT TO REGISTER WITH THE BUBBLE PHASE.
> 
> This is one of the problems of boolean arguments. Changing the logic wouldn't break the API either, but it could break existing apps using the bubble argument, so we can't change this until we break the API.
> 
> > i'd have to double check, but i think i had to manually invert this flag when integrating with an existing framework (which expects the former, per the spec). alas, i want *something* to be merged more than anything else, so feel free to completely ignore this in the name of progress!

We are actually using capture, but with the wrong name in the API to make it even more confusing. The boolean argument we are receiving from the API is what we are passing to WebCore, see:

http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp#L68
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/gobject/GObjectEventListener.h#L38

So, we can simply rename the argument as use_capture.

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