Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Mac] Web Automation: key modifiers for synthesized NSEvents are inco…
…rrect https://bugs.webkit.org/show_bug.cgi?id=178615 Reviewed by Joseph Pecoraro. In both PLATFORM(MAC) platform methods for simulating keyboard interactions, we errantly relied on +[NSEvent modifierFlags] to get the current state of sticky modifiers when creating synthesized events. This is incorrect for two reasons: modifierFlags is never updated when simulating a sequence of events (because all the events are synthesized before any are delivered); and the NSEvent class method only reflects the modifier state of the primary physical keyboard, which is not affected by synthesized NSEvents that happen to have modifier flags. Instead, just keep our own m_currentModifiers state in the session and compute the necessary NSEventModifierFlags to put on each synthesized event. This aligns the implementation with the treatment of sticky keys in the iOS and GTK platform methods. * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): Use and update m_currentModifiers. Canonical link: https://commits.webkit.org/194865@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
3 changed files
with
40 additions
and
20 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