RESOLVED FIXED 40847
[GTK] Fix DOM event dispatch
https://bugs.webkit.org/show_bug.cgi?id=40847
Summary [GTK] Fix DOM event dispatch
Xan Lopez
Reported 2010-06-18 11:12:45 PDT
Patches coming.
Attachments
eventlisteres.diff (8.29 KB, patch)
2010-06-18 11:14 PDT, Xan Lopez
no flags
unittestdispatch.diff (12.50 KB, patch)
2010-06-18 11:15 PDT, Xan Lopez
no flags
Updated patch (11.62 KB, patch)
2010-07-20 15:05 PDT, lauragwd
no flags
uievents.diff (16.75 KB, patch)
2010-08-02 12:14 PDT, Xan Lopez
no flags
uievents.diff (16.74 KB, patch)
2010-08-02 13:45 PDT, Xan Lopez
no flags
Xan Lopez
Comment 1 2010-06-18 11:14:43 PDT
Created attachment 59136 [details] eventlisteres.diff Fix eventlistener creation.
Xan Lopez
Comment 2 2010-06-18 11:15:25 PDT
Created attachment 59138 [details] unittestdispatch.diff Unit test event dispatch.
WebKit Review Bot
Comment 3 2010-06-18 11:19:09 PDT
Attachment 59136 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 WebCore/bindings/gobject/WebKitDOMObject.cpp:25: prop_id is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] WebCore/bindings/gobject/WebKitDOMObject.cpp:34: prop_id is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 4 2010-06-18 11:48:15 PDT
Looks good to me! Only one suggestion: Perhaps move the coreObject->ref() into the GObject itself. Since the object is responsible for the deref(), it makes sense for it to do the ref() as well. You've exposed addEventListener to the bindings (I think). Is that part of some later work, or required for this patch?
Xan Lopez
Comment 5 2010-06-18 13:07:39 PDT
(In reply to comment #4) > Looks good to me! > > Only one suggestion: Perhaps move the coreObject->ref() into the GObject itself. Since the object is responsible for the deref(), it makes sense for it to do the ref() as well. Yeah, I actually planned to do this, but the issue is you cannot know the type of the coreObject in WebKitDOMObject, where that code lives, so you cannot do the casting we do in the wrap method to call ->ref(). On the other hand I don't think that's really needed, I suppose if you cast it to some really low level class where ref/deref are defined it should be more than enough. > > You've exposed addEventListener to the bindings (I think). Is that part of some later work, or required for this patch? I actually didn't, they are blacklisted in CodeGeneratorGObject. I just removed the guards that were there so that the Node wrapper correctly adds its event listeners.
Martin Robinson
Comment 6 2010-06-18 13:29:57 PDT
(In reply to comment #5) > Yeah, I actually planned to do this, but the issue is you cannot > know the type of the coreObject in WebKitDOMObject, where that code > lives, so you cannot do the casting we do in the wrap method to call ->ref(). You're right, of course. I don't think there is shared reference counted class between them. The only approach that I can think of is a vmethod in the GObject. Not sure if it is worth it here.
WebKit Review Bot
Comment 7 2010-06-18 16:29:19 PDT
Gustavo Noronha (kov)
Comment 8 2010-06-23 06:25:26 PDT
Comment on attachment 59136 [details] eventlisteres.diff This looks very good to me. The only conceptual problem I have is with the property - I don't think we should expose a core object in public API (which a property ends up being). Having said that, I understand it would be difficult to deal with this in another way, and approve of the method. Time for GObject to grow private/protected properties? =)
Xan Lopez
Comment 9 2010-06-28 07:41:31 PDT
Comment on attachment 59136 [details] eventlisteres.diff Landed as r62004.
Xan Lopez
Comment 10 2010-07-11 03:18:59 PDT
Comment on attachment 59138 [details] unittestdispatch.diff This needs a bit of updating, removing from the queue.
lauragwd
Comment 11 2010-07-20 15:05:17 PDT
(In reply to comment #10) > (From update of attachment 59138 [details]) > This needs a bit of updating, removing from the queue. I have added an updated patch which builds against the latest commit (apart from the constant changing Changelog)
lauragwd
Comment 12 2010-07-20 15:05:55 PDT
Created attachment 62119 [details] Updated patch
Xan Lopez
Comment 13 2010-08-02 12:14:11 PDT
Created attachment 63244 [details] uievents.diff Updated patch. Adds a custom kit method for Event* instead off doing an ad-hoc create_event in Document, it's less code \o/
WebKit Review Bot
Comment 14 2010-08-02 12:20:26 PDT
Attachment 63244 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WARNING: File exempt from style guide. Skipping: "WebKit/gtk/tests/testdomdomwindow.c" WebCore/bindings/gobject/WebKitDOMEventTargetPrivate.h:25: Alphabetical sorting problem. [build/include_order] [4] WebCore/bindings/gobject/WebKitDOMEventTargetPrivate.h:28: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 2 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Xan Lopez
Comment 15 2010-08-02 13:45:46 PDT
Created attachment 63255 [details] uievents.diff
Gustavo Noronha (kov)
Comment 16 2010-08-03 11:42:58 PDT
Comment on attachment 63255 [details] uievents.diff Seems sane.
Xan Lopez
Comment 17 2010-08-03 12:41:40 PDT
Comment on attachment 63255 [details] uievents.diff Thank you, landed as r64580.
Xan Lopez
Comment 18 2010-08-03 12:41:53 PDT
All patches landed, closing bug.
Note You need to log in before you can comment on or make changes to this bug.