Bug 120648 - [GTK] mouse wheel events are not considered to be mouse events
Summary: [GTK] mouse wheel events are not considered to be mouse events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-03 13:28 PDT by Grant Gayed
Modified: 2013-10-09 06:06 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.19 KB, patch)
2013-10-08 06:34 PDT, Carlos Garcia Campos
gustavo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed 2013-09-03 13:28:33 PDT
When a mouse wheel event is received, various WebKitGTK API that is used to get info from the event, such as webkit_dom_mouse_event_get_screen_?() and webkit_dom_mouse_event_get_button(), fail with an error spew like:

** CRITICAL **: glong webkit_dom_mouse_event_get_screen_y(WebKitDOMMouseEvent*): assertion `WEBKIT_DOM_IS_MOUSE_EVENT(self)' failed

** CRITICAL **: gushort webkit_dom_mouse_event_get_button(WebKitDOMMouseEvent*): assertion `WEBKIT_DOM_IS_MOUSE_EVENT(self)' failed

I think MouseWheel events should be considered to be mouse events (?).
Comment 1 Carlos Garcia Campos 2013-10-08 00:25:13 PDT
We don't expose WheelEvent in the DOM bindings, but WheelEvent derives from MouseEvent so it should be considered a mouse event in any case. Could you share more code to try to reproduce the issue?
Comment 2 Carlos Garcia Campos 2013-10-08 00:29:06 PDT
bool WheelEvent::isMouseEvent() const
{
    return false;
}
Comment 3 Carlos Garcia Campos 2013-10-08 05:31:30 PDT
(In reply to comment #2)
> bool WheelEvent::isMouseEvent() const
> {
>     return false;
> }

ok, this is used internally to handle clicks and moves, that's why this returns false. We should check if the event interface type is WheelEventInterfaceType to create a mouse event, but I guess it would be better to expose WheelEvent in our bindings, no?
Comment 4 Carlos Garcia Campos 2013-10-08 06:34:27 PDT
Created attachment 213682 [details]
Patch

Expose WheelEvent in GObject DOM bindings, that way we make sure the generated object is a WheelEvent and therefore a MouseEvent
Comment 5 Gustavo Noronha (kov) 2013-10-08 07:34:25 PDT
Comment on attachment 213682 [details]
Patch

Makes sense to me, I guess we should get a rubber-stamp from someone else just in case, but we have been known to not use the 2 reviews rule for the DOM bindings heh
Comment 6 Carlos Garcia Campos 2013-10-09 06:06:18 PDT
Committed r157163: <http://trac.webkit.org/changeset/157163>