-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
WebDriver: [macOS] [Actions] [Key] Shift modifier not applying to typed text #7208
Merged
webkit-early-warning-system
merged 1 commit into
WebKit:main
from
patrickangle:eng/b248770-webdriver-macos-characters-not-honoring-modifiers
Jan 18, 2023
Merged
WebDriver: [macOS] [Actions] [Key] Shift modifier not applying to typed text #7208
webkit-early-warning-system
merged 1 commit into
WebKit:main
from
patrickangle:eng/b248770-webdriver-macos-characters-not-honoring-modifiers
Jan 18, 2023
Conversation
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
EWS run on previous version of this PR (hash 2cef1f2) |
burg
approved these changes
Jan 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix!
patrickangle
force-pushed
the
eng/b248770-webdriver-macos-characters-not-honoring-modifiers
branch
from
January 17, 2023 21:55
2cef1f2
to
f0e0e90
Compare
EWS run on current version of this PR (hash f0e0e90) |
β¦ed 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
webkit-early-warning-system
force-pushed
the
eng/b248770-webdriver-macos-characters-not-honoring-modifiers
branch
from
January 18, 2023 18:32
f0e0e90
to
7bee9f5
Compare
Committed 259039@main (7bee9f5): https://commits.webkit.org/259039@main Reviewed commits have been landed. Closing PR #7208 and removing active labels. |
webkit-commit-queue
removed
the
merge-queue
Applied to send a pull request to merge-queue
label
Jan 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
7bee9f5
f0e0e90