You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebDriver: [macOS] [Actions] [Key] Shift modifier not applying to typed text
https://bugs.webkit.org/show_bug.cgi?id=248770
rdar://100588610
Reviewed by BJ Burg.
AppKit expects the `characters` for an NSEvent to be pre-transformed to the actual character that will be typed, which
means for a capital letter, sending the key code for a letter with the shift modifier held should result in the capital
form of that letter being the `characters`. This also add support for composed characters, like Shift+Option+K resulting
in the Apple logo, or Shift+Option+8 resulting in the degree symbol.
The clearest way to obtain the OS-defined mapping for a letter and its modifiers is to create a temporary NSEvent and
call `-[NSEvent characterTransformingModifiers:]`, which applies the provided modifiers to an existing event's
`characters`, which we can then use to create the actual NSEvents we will dispatch to the system. Alternatively, we
could hardcode WebDriver's list of "shifted" characters, but that only covers keys on a US-English keyboard, and does
not provide any allowance for macOS's various Option/Shift modified key chords to produce special characters.
This progresses the following WPT test cases:
webdriver/tests/perform_actions/key_modifiers.py::test_shift_modifier_generates_capital_letters[\ue008]
webdriver/tests/perform_actions/key_modifiers.py::test_shift_modifier_generates_capital_letters[\ue050]
* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
Canonical link: https://commits.webkit.org/259039@main
0 commit comments