Closed Bug 1968855 Opened 7 months ago Closed 4 months ago

Add a "widget" event synthesization API for mouse events

Categories

(Core :: Panning and Zooming, enhancement, P2)

enhancement
Points:
3

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m17])

Attachments

(1 file)

This bug tracks introducing an nsIDOMWindowUtils API for synthesizing "widget" mouse events which will be sent to the parent process and go through APZ processing there, but unlike "native" mouse events will not be injected into the operating system's native event queue.

Blocks: 1968859

The implementation can be similar to what I did over on bug 1957955.

See Also: → 1957955
Priority: -- → P2
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Points: --- → 3
Whiteboard: [webdriver:m17]

With the patch applied we are no longer able to build Firefox because the number of arguments for sendMouseEvent exceeds the maximum number of allowed arguments. As result work is soon in progress to move this method to webidl and we should wait for this work to be done via bug 1977774.

Depends on: 1977774
Blocks: 1894654
No longer blocks: 1894654

With my updated patch the test dom/events/test/test_coalesce_mousewheel.html is failing on Windows and Linux, but not macOS and Android:

https://treeherder.mozilla.org/jobs?repo=try&revision=2e64b952f571066b3b83330afb2671316fdd0018

I've taken a look at some failures and in all the cases the screenshot shows an open context menu with the Open Link in new Container tab entry hovered.

Even though I did not change this test some other test that runs before most likely doesn't close the context menu once it finished.

Or this is something else given the following error some lines before: JavaScript error: http://mochi.test:8888/tests/SimpleTest/EventUtils.js, line 206: Error: The element or the window did not become interactive. As such we do not start the test and would run int a timeout if the window never gets the focus.

It's indeed the left-over context menu from the test dom/events/test/test_click_hold_context_menus.html which is causing this above error in EventUtils, leading the coalesce mousewheel test to timeout. By using preventDefault() we can still run the test, which checks for contextmenu events, while not causing the context menu to actually open.

Fixing this locally reveals some other failures in dom/events/test/test_moz_mouse_pixel_scroll_event.html. Trying to figure out now why those are happening.

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #6)

Fixing this locally reveals some other failures in dom/events/test/test_moz_mouse_pixel_scroll_event.html. Trying to figure out now why those are happening.

Hm, it looks like that this is an issue that I can only see locally but not in a try build. For the most recent one it looks all fine:
https://treeherder.mozilla.org/jobs?repo=try&revision=4253547d30c01efc0e150dfadec659ab28aca3ee

Hiro, not sure if you have the time to try if you can reproduce it locally. If not I would suggest to just land the patches if the upcoming complete try build works fine which I will trigger in about 1h after all the jobs from the above try are done.

Flags: needinfo?(hikezoe.birchill)

Ouch, I accidentally pushed the last try as artifact and not full build. Here a new try build:
https://treeherder.mozilla.org/jobs?repo=try&revision=a84f0918b55e812296f667e900ed0573ae4fa329

When I run "./mach mochitest --headless dom/events/test/" locally I do see this error;

FAIL doTests, Should be computed from actual scroll target or root if not scrollable in the direction (root, 2, both) (deltaMode: DOM_DELTA_PAGE, deltaX: -1, deltaY: -1): vertical event detail is wrong - got 568, expected 270

and something similar errors with/without D257524.

So that's not a regression by D257524.

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #4)

With my updated patch the test dom/events/test/test_coalesce_mousewheel.html is failing on Windows and Linux, but not macOS and Android:

https://treeherder.mozilla.org/jobs?repo=try&revision=2e64b952f571066b3b83330afb2671316fdd0018

I've taken a look at some failures and in all the cases the screenshot shows an open context menu with the Open Link in new Container tab entry hovered.

Even though I did not change this test some other test that runs before most likely doesn't close the context menu once it finished.

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #4)

With my updated patch the test dom/events/test/test_coalesce_mousewheel.html is failing on Windows and Linux, but not macOS and Android:

https://treeherder.mozilla.org/jobs?repo=try&revision=2e64b952f571066b3b83330afb2671316fdd0018

I've taken a look at some failures and in all the cases the screenshot shows an open context menu with the Open Link in new Container tab entry hovered.

Nice find!

Flags: needinfo?(hikezoe.birchill)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #9)

FAIL doTests, Should be computed from actual scroll target or root if not scrollable in the direction (root, 2, both) (deltaMode: DOM_DELTA_PAGE, deltaX: -1, deltaY: -1): vertical event detail is wrong - got 568, expected 270

and something similar errors with/without D257524.

Ah, good. I completely missed to test without my patch. Thanks for confirming.

Regressions: 1985485
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/307439d0290d https://hg.mozilla.org/integration/autoland/rev/db575e6f9756 [dom] Add a "widget" event synthesization API for mouse events. r=webidl,hiro,smaug
Pushed by chorotan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c985c328b88d https://hg.mozilla.org/integration/autoland/rev/9582a770f855 Revert "Bug 1968855 - [dom] Add a "widget" event synthesization API for mouse events. r=webidl,hiro,smaug" for causing mochitest failures on test_pointerrawupdate_event_count.html

Backed out for causing mochiutest failures on test_pointerrawupdate_event_count.html

Backout link

Push with failures

Failure log

Flags: needinfo?(hskupin)

We have to re-add the removed asyncEnabled flag which indeed seems to be required. I'll fix that and push again.

Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fc47d6cf7be5 https://hg.mozilla.org/integration/autoland/rev/57a69c3bf308 [dom] Add a "widget" event synthesization API for mouse events. r=webidl,hiro,smaug
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Blocks: 1976145
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: