Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1686666] Make marionette events use EventUtil.js directly #32989

Merged
merged 1 commit into from Feb 26, 2022

Conversation

moz-wptsync-bot
Copy link
Collaborator

Rather than copying over the code from EventUtils, load EventUtils.js
into event.js. This is slightly complicated by the fact that
EventUtils.js depends on the existence of a global named window. So
instead of loading the script as a normal component, we need to use
loadSubScript to create an instance of the script with the required
window binding (this is similar to the approach the CDP module uses).

The actual API changes for mouse events are ~trivial, but for key
events things are a little more involved. The code previously (in
effect) called synthesizeKey with the virtual keycode as the aKey
argument. However EventUtils.js documents this as deprecated, so we
switch to providing the actual key, with the KEY_ prefix for
non-printable characters.

To make this easier, all the data about various keys from the
WebDriver spec is collapsed into a single lookup table, rather than
having a table for each interesting property.

Differential Revision: https://phabricator.services.mozilla.com/D138449

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1686666
gecko-commit: b609cc1c05e7108ed02ed97d037bc581b47cfa29
gecko-reviewers: webdriver-reviewers, whimboo

Rather than copying over the code from EventUtils, load EventUtils.js
into event.js. This is slightly complicated by the fact that
EventUtils.js depends on the existence of a global named `window`. So
instead of loading the script as a normal component, we need to use
`loadSubScript` to create an instance of the script with the required
window binding (this is similar to the approach the CDP module uses).

The actual API changes for mouse events are ~trivial, but for key
events things are a little more involved. The code previously (in
effect) called synthesizeKey with the virtual keycode as the aKey
argument. However EventUtils.js documents this as deprecated, so we
switch to providing the actual key, with the `KEY_` prefix for
non-printable characters.

To make this easier, all the data about various keys from the
WebDriver spec is collapsed into a single lookup table, rather than
having a table for each interesting property.

Differential Revision: https://phabricator.services.mozilla.com/D138449

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1686666
gecko-commit: b609cc1c05e7108ed02ed97d037bc581b47cfa29
gecko-reviewers: webdriver-reviewers, whimboo
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Firefox project.

@moz-wptsync-bot moz-wptsync-bot merged commit 693401a into master Feb 26, 2022
@moz-wptsync-bot moz-wptsync-bot deleted the gecko/1686666 branch February 26, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants