SynthesizeMouseAtPoint sends incorrect value for buttons
Categories
(Testing :: Mochitest, defect)
Tracking
(firefox87 fixed)
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: andrew, Assigned: andrew)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
Steps to reproduce:
Currently the default value of buttons is set to
MOUSE_BUTTONS_NOT_SPECIFIED, which defers calculation of the value to
the DOMWindowUtils GetButtonsFlagForButton function. This calculates a
default value based upon the value of the button key.
By specifying a default button value of 0, which has a meaning of
ePrimary, the buttons value is calculated as the
ePrimaryFlag (1), suggesting that a button was pressed.
synthesizeMouseAtPoint(x, y, {type: 'mousemove'}, window)
Actual results:
An event was generated with properties including:
{
type: 'mousemove',
button: 0,
buttons: 1,
}
Expected results:
An event was generated with properties including:
{
type: 'mousemove',
button: 0,
buttons: 0,
}
Assignee | ||
Comment 1•3 years ago
|
||
Currently the default value of buttons is set to
MOUSE_BUTTONS_NOT_SPECIFIED, which defers calculation of the value to
the DOMWindowUtils GetButtonsFlagForButton function. This calculates a
default value based upon the value of the button key.
By specifying a default button value of 0, which has a meaning of
ePrimary, the buttons value is calculated as the
ePrimaryFlag (1), suggesting that a button was pressed.
This patch changes the behaviour to set the value of buttons based on
the original value of button before the default was applied. The value
of buttons also considers the event type to ensure that a mousedown
event has a default value calculated by DOMWindowUtils.
With the new behaviour:
- if a value was explicitly set for buttons, this is used
- if a value was explicitly set for button, then the not-specified
constant is used to defer calculation to DOMWindowUtils - if an event type was specified and that event type was not the
'mousedown' event, then the no-button constant is used - if an event type was not specified or it was for the 'mousedown'
event, then the not-specified constant is used to defer calculation to
DOMWindowUtils
Updated•3 years ago
|
Pushed by nerli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a9483083a4d Set the value of buttons based on provided event r=smaug
Comment 3•3 years ago
•
|
||
Backed out changeset 4a9483083a4d (Bug 1686663) for causing bc failures in browser_selectpopup.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/6d2246c011f5f2f6961750353850b68beb3e812c
Failure log: https://treeherder.mozilla.org/logviewer?job_id=327065548&repo=autoland&lineNumber=1980
(Update) Looks to have also caused failures in browser_anti_clickjacking.js:
https://treeherder.mozilla.org/logviewer?job_id=327051449&repo=autoland&lineNumber=2100
Comment 4•3 years ago
|
||
Hi Andrew, I saw that the patch got backed out. Have you had a chance yet to check why browser/base/content/test/forms/browser_selectpopup.js
is failing here?
Assignee | ||
Comment 5•3 years ago
|
||
Hi @whimboo,
I started having a look but have been busy the past week. I have a fix for the browser/base/content/test/forms/browser_selectpopup.js
but I haven’t had a chance to look at browser/extensions/formautofill/test/browser/creditCard/browser_anti_clickjacking.js
yet.
I’ve not had a chance to work out why that ones failing as I can’t see any direct use of mousemove in there.
Comment 6•3 years ago
|
||
Thanks for the update. I had a look at the Treeherder link for the backout and I can only see the failures for browser_selectpopup.js
, but none for browser_anti_clickjacking.js
. Can you remember where that latter failure actually happened?
Assignee | ||
Comment 7•3 years ago
|
||
Hi @whimboo,
I can replicate those issues locally but I don’t see how they relate to the changes here and I’m not quite sure where to fix them. I see them at the second tree herder link: https://treeherder.mozilla.org/logviewer?job_id=327051449&repo=autoland&lineNumber=2100
I’ve updated the commit in Phabricator to fix the issues in browser_selectpopup.js
but I’m unable to run any try jobs to confirm the fix.
Comment 8•3 years ago
|
||
Thanks for the link. I had a quick look and what looks strange is that getDisplayedPopupItems()
should be run only once, but given the log it runs twice:
https://treeherder.mozilla.org/logviewer?job_id=327093066&repo=autoland&lineNumber=2091-2092
You could add some more info(msg)
calls to the test or the used head.js
file so we can figure out what's wrong with the first popup element.
If browser_selectpopup.js
works fine locally with your patch applied, then it's fine and we can test on try once the credit card test works.
Assignee | ||
Comment 9•3 years ago
|
||
Any chance you could kick off the try jobs again please. I’m unable to replicate this issue any further after rebasing. Thanks
Comment 10•3 years ago
|
||
Done: https://treeherder.mozilla.org/jobs?repo=try&revision=680c8b780d03a48a36da37006a44ae911a2c887c
Comment 11•3 years ago
|
||
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/c50c4d146af1 Set the value of buttons based on provided event r=smaug
Comment 12•3 years ago
|
||
bugherder |
Description
•