RESOLVED FIXED 187998
[WPE] Implement MouseEvent.buttons
https://bugs.webkit.org/show_bug.cgi?id=187998
Summary [WPE] Implement MouseEvent.buttons
Carlos Garcia Campos
Reported 2018-07-25 04:48:32 PDT
Attachments
WIP (10.26 KB, patch)
2018-07-25 04:52 PDT, Carlos Garcia Campos
no flags
Patch (19.43 KB, patch)
2018-08-03 02:22 PDT, Carlos Garcia Campos
zan: review+
Carlos Garcia Campos
Comment 1 2018-07-25 04:52:56 PDT
Created attachment 345753 [details] WIP The patch should include a WPEBackend version bump, it's WIP because we need a new WPEBackend release with the new API.
Adrian Perez
Comment 2 2018-07-25 10:27:54 PDT
Comment on attachment 345753 [details] WIP How about other fields from the MouseEvent DOM object? For example, are keyboard modifiers (Ctrl, Alt, etc) already being filled or would it be needed to add more fields in the wpe_input_pointer_event struct?
Carlos Garcia Campos
Comment 3 2018-07-26 00:42:25 PDT
(In reply to Adrian Perez from comment #2) > Comment on attachment 345753 [details] > WIP > > How about other fields from the MouseEvent DOM object? For example, are > keyboard modifiers (Ctrl, Alt, etc) already being filled or would it be > needed to add more fields in the wpe_input_pointer_event struct? The spec doesn't say keyboard modifiers should be filled in buttons field.
Adrian Perez
Comment 4 2018-07-26 09:05:42 PDT
(In reply to Carlos Garcia Campos from comment #3) > (In reply to Adrian Perez from comment #2) > > Comment on attachment 345753 [details] > > WIP > > > > How about other fields from the MouseEvent DOM object? For example, are > > keyboard modifiers (Ctrl, Alt, etc) already being filled or would it be > > needed to add more fields in the wpe_input_pointer_event struct? > > The spec doesn't say keyboard modifiers should be filled in buttons field. The spec mentions that there are *other* fields for the keyboard modifiers. What I wanted to point out is that the proposed patch does not handle them, and I was wondering whether other field(s) in the struct should be added to cover those. I guess that could be handled in a separate bug+patch. (FWIW, after re-reading the spec a couple of times, to me is quite clear that the “MouseEvent.{ctrl,shift,alt,meta}Key” properties are *mandatory* — nothing in the spec hints at them being optional.)
Carlos Garcia Campos
Comment 5 2018-07-26 22:52:36 PDT
(In reply to Adrian Perez from comment #4) > (In reply to Carlos Garcia Campos from comment #3) > > (In reply to Adrian Perez from comment #2) > > > Comment on attachment 345753 [details] > > > WIP > > > > > > How about other fields from the MouseEvent DOM object? For example, are > > > keyboard modifiers (Ctrl, Alt, etc) already being filled or would it be > > > needed to add more fields in the wpe_input_pointer_event struct? > > > > The spec doesn't say keyboard modifiers should be filled in buttons field. > > The spec mentions that there are *other* fields for the keyboard > modifiers. What I wanted to point out is that the proposed patch > does not handle them, and I was wondering whether other field(s) > in the struct should be added to cover those. I guess that could > be handled in a separate bug+patch. > > (FWIW, after re-reading the spec a couple of times, to me is quite > clear that the “MouseEvent.{ctrl,shift,alt,meta}Key” properties > are *mandatory* — nothing in the spec hints at them being optional.) Ah! other fields. This bug is only about buttons field. I don't know if the keyborad modifier fields are working in WPE, but it's definitely out of scope of this bug.
Carlos Garcia Campos
Comment 6 2018-08-03 02:22:56 PDT
Zan Dobersek
Comment 7 2018-08-03 02:30:13 PDT
Comment on attachment 346464 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=346464&action=review > Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:94 > + case 1: > + modifier = wpe_input_pointer_modifier_button1; > + break; Can these return the relevant modifier value, and the default clause just return 0? Or, if the compiler complains, have the default clause break and then return by default?
Carlos Garcia Campos
Comment 8 2018-08-03 02:38:31 PDT
Claudio Saavedra
Comment 9 2018-09-18 01:58:27 PDT
(In reply to Carlos Garcia Campos from comment #5) > (In reply to Adrian Perez from comment #4) > > (FWIW, after re-reading the spec a couple of times, to me is quite > > clear that the “MouseEvent.{ctrl,shift,alt,meta}Key” properties > > are *mandatory* — nothing in the spec hints at them being optional.) > > Ah! other fields. This bug is only about buttons field. I don't know if the > keyborad modifier fields are working in WPE, but it's definitely out of > scope of this bug. Checking bug 189664, I see that the wkEventModifiers are not being propagated from WTR down to WK. I don't know what the original intention of the modifiers field in wpe_input_pointer_event was, but I suspect that it was keyboard modifiers, not pressed mouse buttons, as it's implemented in this bug's patch. I suppose it's possible to serialize both pressed buttons and keyboard modifiers in the same modifiers field (it's 32 bits, after all), so it shouldn't be much of an issue.
Claudio Saavedra
Comment 10 2018-09-18 05:04:13 PDT
Implemented in bug 189697.
Note You need to log in before you can comment on or make changes to this bug.