forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1528289 - part 2: Dispatch same events on the web contents when a…
…utoscroll is canceled with a click r=Gijs,edgar Chrome behaves like this: 1. When user starts autoscroll with a middle click, `mousedown` and `mouseup` are fired, but `auxclick` nor `paste` event is not fired. 2. When user ends autoscroll with a left click, only `mouseup` event is fired. I.e, `mousedown` nor `click` event is not fired. 3. When user ends autoscroll with a middle click, only `mouseup` event is fired. I.e., `mousedown`, `auxclick` nor `paste` events is not fired. 4. When user ends autoscroll with a right click, `mouseup` and `contextmenu` events are fired, but `mousedown` and `auxclick` events are not fired. This patch emulates these Chrome's behavior as far as possible. However, unfortunately, we cannot do exactly same behavior without some big patches because each widget (`nsWindow` or `nsChildView`) discards a mouse event which rolled up a widget before dispatching it into the DOM. Therefore, for now, this patch does not fix the following issues: 1. `mousedown` event is not fired in content when clicking outside the autoscroller to close it except when pressing the secondary button or on any buttons on Linux. 2. `mouseup` event is not fired in content when clicking outside the autoscroller to close it except when pressing the primary button macOS. 3. `click` event and `auxclick` events are fired when clicking outside the autoscroller with the secondary button. So, the middle button `click`/`auxclick` events and `paste` event which is reported to the bug won't be fired with this patch. I'll file follow up bugs. Differential Revision: https://phabricator.services.mozilla.com/D104652
- Loading branch information
1 parent
2461631
commit 77d74d9
Showing
10 changed files
with
563 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.