Cannot synthesize native middle/right mouse button event via `nsIDOMWindowUtils::SendNativeMouseEvent()` on Linux
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(13 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1691622 - part 6: Merge `synthesizeNativeMouseClick*` with `synthesizeNativeMouseEvent*` r=smaug
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The API was defined with assuming that a native event is mapped to a mouse button down and up. However, on Linux and Android (and 4th or later buttons on Windows) do not so. They just have "mousedown" or "mouseup" message and specifies additional information of mouse button ID.
Assignee | ||
Comment 1•4 years ago
|
||
I'll fix this only for Linux for now.
Assignee | ||
Comment 2•4 years ago
|
||
In these days, API should take an Object
instead of multiple arguments
since the callers look like using "named" arguments and this allows to
add new optional arguments with changing not all callers.
This patch also changes similar API for APZ aware tests for keeping
consistent style for their users.
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
With adding new feild to the aParam
, synthesizeNativeMouseClick
can
work as synthesizenativeMouseClickAtCenter
too. Therefore, we can get
rid of the redundant API.
Additionally, this patch makes synthesizeNativeMouseClickWithAPZ
can
take the new field for consistency between them.
Depends on D105755
Assignee | ||
Comment 4•4 years ago
|
||
Some tests want to specify screen position directly. Therefore, they should
have additional fields in the Object
param to take offset in screen.
Depends on D105756
Assignee | ||
Comment 5•4 years ago
|
||
Surprisingly, they don't take modifiers, and
nsIWidget::SynthesizeNativeMouseEvent()
which are implementations of
nsIDOMWindowUtils::SendNativeMouseEvent()
treat given modifier flags
are native's ones, and handle modifiers only on macOS. Therefore, this
patch makes them handle native modifiers of Gecko.
Unfortunately, I'm not so familiar with Android API, and in the short
term, I don't need the support on Android. Therefore, this patch just
adds a TODO comment on Android widget.
Additionally, we don't have a simple way to set modifier only while
posting a mouse input on Windows too. It requires complicated code.
Therefore, I don't add the support for it on Windows too.
Depends on D105757
Assignee | ||
Comment 6•4 years ago
|
||
Let's make synthesizeNativeMouseClick*
take an event type, and only when
it's click, it should send native mouse event twice.
Then, we can all them synthesizeNativeMouseEvent*
.
Depends on D105758
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D105759
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D105760
Assignee | ||
Comment 9•4 years ago
|
||
Now, there are no users of this API. However,
nsIWidget::SynthesizeNativeMouseMove()
is still used by EventStateManager
.
Even though it's just redirected to nsIWidget::SynthesizeNativeMouseEvent()
,
but it hides the native event message from EventStateManager
. Therefore,
this patch keeps the widget API for now.
Depends on D105761
Assignee | ||
Comment 10•4 years ago
|
||
Currently, it takes a raw native message value, but it makes JS content too
complicated. And on Linux, it cannot synthesize non-primary button events
because GDK has only button press and release messages which dont' include
mouse button information.
For solving these problems, this patch creates a new abstract native message
as nsIWidget::NativeMouseMessage
and makes each widget converts it to
a platform native message.
Additionally, this patch adds an argument to make it possible its callers
to specify pressing or releasing mouse button with a DOM mouse button value.
Note that the following patch adds new argument to
synthesizeNativeEventMouse*
for mochitests and which will be tested by
new tests.
Depends on D105762
Assignee | ||
Comment 11•4 years ago
|
||
Now, it should take button
argument whose default value is 0 (primary
button).
Depends on D105763
Assignee | ||
Comment 12•4 years ago
|
||
For making the test framework/API change easier, such raw API shouldn't be
used directly. Therefore, this patch makes tests using it directly stop
using it and use synthesizeNativeMouseEvent
instead.
However, this patch does not fix browser_touch_event_iframes.js
because
it accesses the API from ContentTask
. So, EventUtils.js
isn't available
without larger change.
Depends on D105764
Assignee | ||
Comment 13•4 years ago
|
||
For minimizing the previous patch changes, scale
's default value for
screenX/Y
is treated as 1.0. It means that screenX/Y
are device
pixels by default, but offsetX/Y
are in CSS pixels by default. This
difference may make developers confused. Therefore, we should align the
default unit of them to screenPixelsPerCSSPixel
. I.e., their default
unit becomes CSS pixels.
Depends on D105765
Comment 14•4 years ago
|
||
Assignee | ||
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e649d8ff7787
https://hg.mozilla.org/mozilla-central/rev/301ce838d678
https://hg.mozilla.org/mozilla-central/rev/54b426637c32
https://hg.mozilla.org/mozilla-central/rev/727097623436
https://hg.mozilla.org/mozilla-central/rev/d21beb190305
https://hg.mozilla.org/mozilla-central/rev/dc5e230ba557
https://hg.mozilla.org/mozilla-central/rev/6af85d93a7f2
https://hg.mozilla.org/mozilla-central/rev/b3e0851f5cec
https://hg.mozilla.org/mozilla-central/rev/1008909e3dde
https://hg.mozilla.org/mozilla-central/rev/5fc38c58de82
https://hg.mozilla.org/mozilla-central/rev/da33e4b8fa18
https://hg.mozilla.org/mozilla-central/rev/ed9c8bd8966c
https://hg.mozilla.org/mozilla-central/rev/f3050f40efe5
Description
•