-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[iOS 26] Using AutoFill in a password field echoes the last character #47244
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
Merged
+86
−20
Conversation
This file contains hidden or 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 current version of this PR (hash a2f5192) |
rniwa
approved these changes
Jun 26, 2025
aprotyas
approved these changes
Jun 26, 2025
Thanks for the reviews! |
https://bugs.webkit.org/show_bug.cgi?id=295032 rdar://148549180 Reviewed by Abrar Rahman Protyasha and Ryosuke Niwa. Safari AutoFill in macOS Tahoe / iOS 26 now creates and dispatches `TextEvent`s to simulate user input. While this more closely simulates some typing behaviors (and improves compatibility on some websites), it also has the byproduct of triggering password echo on iOS (flashing the last typed character in a password field). Fix this by not echoing the last character in a password field, when the triggering text event is untrusted. See below for more details. * LayoutTests/editing/input/untrusted-textevent-does-not-echo-password-expected.html: Added. * LayoutTests/editing/input/untrusted-textevent-does-not-echo-password.html: Added. Add a layout test to exercise the change by verifying that the password does not echo when creating and dispatching TextEvents in a password field. This test simply ref's against a password field with a `value` attribute set to the same string. * Source/WebCore/editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::inputText): (WebCore::CompositeEditCommand::insertTextIntoNode): (WebCore::CompositeEditCommand::replaceTextInNode): Add more plumbing for the `AllowPasswordEcho` flag. * Source/WebCore/editing/CompositeEditCommand.h: * Source/WebCore/editing/EditCommand.h: Add a new enum type, representing whether or not we should allow password echo when inserting text. This enum is plumbed from `TypingCommand` -> `InsertTextCommand` -> `InsertIntoTextNodeCommand` when typing, and finally checked in `InsertIntoTextNodeCommand::shouldEnablePasswordEcho`. * Source/WebCore/editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand): (WebCore::InsertIntoTextNodeCommand::shouldEnablePasswordEcho const): Pull this logic out into a private helper method, for better readability. (WebCore::InsertIntoTextNodeCommand::doApply): * Source/WebCore/editing/InsertIntoTextNodeCommand.h: Store the `AllowPasswordEcho` flag as a member. (WebCore::InsertIntoTextNodeCommand::create): * Source/WebCore/editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::InsertTextCommand): (WebCore::InsertTextCommand::doApply): Plumb the `AllowPasswordEcho` state into `InsertIntoTextNodeCommand`. * Source/WebCore/editing/InsertTextCommand.h: Store the `AllowPasswordEcho` flag as a member. (WebCore::InsertTextCommand::create): * Source/WebCore/editing/TypingCommand.cpp: (WebCore::TypingCommand::insertTextRunWithoutNewlines): Plumb the value of `AllowPasswordEcho` into `InsertTextCommand` when typing; this value is derived from `triggeringEventIsUntrusted()`, which is in turn derived from whether or not the dispatched text event is trusted. Canonical link: https://commits.webkit.org/296673@main
a2f5192
to
84f5cba
Compare
Committed 296673@main (84f5cba): https://commits.webkit.org/296673@main Reviewed commits have been landed. Closing PR #47244 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
New Bugs
Unclassified bugs are placed in this component until the correct component can be determined.
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.
84f5cba
a2f5192