AutoFill unexpectedly scrolls to reveal text fields when inserting text#45476
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash ff665e3) Details |
pxlcoder
approved these changes
May 16, 2025
aprotyas
approved these changes
May 16, 2025
rniwa
reviewed
May 16, 2025
Collaborator
|
EWS run on current version of this PR (hash ce43d75) Details |
https://bugs.webkit.org/show_bug.cgi?id=293098 rdar://149708409 Reviewed by Aditya Keerthi and Abrar Rahman Protyasha. When performing AutoFill, Safari's injected script creates and dispatches `TextEvent`s in each text field to simulate text input, in such a way that the resulting DOM events dispatched to the page closely match those dispatched when typing manually. While generally good for AutoFill compatibility, this results in some unwanted behaviors, such as the scroll position potentially flickering if some of the form fields lie offscreen, due to the fact that we'll attempt to reveal the selection when dispatching `TextEvent`. We already avoid scrolling to reveal the selection when using `document.execCommand(…)` to insert text, so we can fix this bug by applying a similar treatment to the case where `TextEvent` DOM events are untrusted (created using `Document.createEvent` / `Event.initTextEvent`). * LayoutTests/editing/inserting/no-scroll-after-text-event-created-from-bindings-expected.txt: Added. * LayoutTests/editing/inserting/no-scroll-after-text-event-created-from-bindings.html: Added. Add a test that inserts text by creating and dispatching a `TextEvent` in a focused field. * Source/WebCore/editing/Editor.cpp: (WebCore::Editor::insertTextWithoutSendingTextEvent): Canonical link: https://commits.webkit.org/295008@main
ce43d75 to
76c1453
Compare
Collaborator
|
Committed 295008@main (76c1453): https://commits.webkit.org/295008@main Reviewed commits have been landed. Closing PR #45476 and removing active labels. |
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
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.
76c1453
ce43d75
🧪 ios-wk2-wpt🧪 api-ios