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

fix: populate phase of WebMouseWheelEvents in webContents.sendInputEvent #17757

Merged
merged 1 commit into from Apr 16, 2019

Conversation

ppontes
Copy link
Member

@ppontes ppontes commented Apr 11, 2019

When wheel scroll latching and async wheel events are enabled, phase information gets added to WebMouseWheelEvents when they are generated from native events. Chromium expects this information to be available and asserts that expectation with a DCHECK. Phase information must be synthesized and set to a WebMouseWheelEvent that is generated with webContents.sendInputEvent or a DCHECK will fail in Chromium.

The very same problem was found and fixed in Chromium for the simulation of mouse wheel events from the devtools. See ticket and fix commit. This is basically a port of that fix to webContents.sendInputEvent.

This makes it possible to run the test in this PR.

Checklist

Release Notes

Notes: Using webContents.sendInputEvent to send a WebMouseWheelEvent now has the expected effect.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 11, 2019
@ppontes ppontes requested a review from miniak April 11, 2019 11:11
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 12, 2019
Copy link
Contributor

@alexeykuzmin alexeykuzmin left a comment

Choose a reason for hiding this comment

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

Using webContents.sendInputEvent to send a WebMouseWheelEvent no longer fails a Chromium pre-condition, which was causing a failed DCHECK in debug builds.

Are there any changes noticeable by users?

@ppontes ppontes force-pushed the ppontes/populate-phase-for-wheel-events branch from b20ef0d to 99df065 Compare April 16, 2019 14:48
@ppontes ppontes force-pushed the ppontes/populate-phase-for-wheel-events branch from 99df065 to ab01c43 Compare April 16, 2019 14:49
@ppontes
Copy link
Member Author

ppontes commented Apr 16, 2019

@alexeykuzmin updated the release note to be more relevant to users.

@alexeykuzmin alexeykuzmin merged commit a7e22c7 into master Apr 16, 2019
@release-clerk
Copy link

release-clerk bot commented Apr 16, 2019

Release Notes Persisted

Using webContents.sendInputEvent to send a WebMouseWheelEvent now has the expected effect.

@alexeykuzmin alexeykuzmin deleted the ppontes/populate-phase-for-wheel-events branch April 16, 2019 16:23
kiku-jw pushed a commit to kiku-jw/electron that referenced this pull request May 16, 2019
@miniak
Copy link
Contributor

miniak commented May 29, 2019

/trop run backport-to 4-2-x

@trop
Copy link
Contributor

trop bot commented May 29, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "4-2-x" here we go! :D

@miniak
Copy link
Contributor

miniak commented May 29, 2019

/trop run backport-to 5-0-x

@trop
Copy link
Contributor

trop bot commented May 29, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "5-0-x" here we go! :D

@trop
Copy link
Contributor

trop bot commented May 29, 2019

I have automatically backported this PR to "4-2-x", please check out #18494

@miniak
Copy link
Contributor

miniak commented May 29, 2019

/trop run backport-to 6-0-x

@trop trop bot added the in-flight/4-2-x label May 29, 2019
@trop
Copy link
Contributor

trop bot commented May 29, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "6-0-x" here we go! :D

@trop
Copy link
Contributor

trop bot commented May 29, 2019

I have automatically backported this PR to "5-0-x", please check out #18495

@trop
Copy link
Contributor

trop bot commented May 29, 2019

I was unable to backport this PR to "6-0-x" cleanly;
you will need to perform this backport manually.

@sofianguy sofianguy added this to Fixed in 5.0.3 in 5.0.x Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.0.x
Fixed in 5.0.3
Development

Successfully merging this pull request may close these issues.

None yet

4 participants