Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 76c14537ee04f6d8e72072a80b580e64a81fe835
      
https://github.com/WebKit/WebKit/commit/76c14537ee04f6d8e72072a80b580e64a81fe835
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-05-16 (Fri, 16 May 2025)

  Changed paths:
    A 
LayoutTests/editing/inserting/no-scroll-after-text-event-created-from-bindings-expected.txt
    A 
LayoutTests/editing/inserting/no-scroll-after-text-event-created-from-bindings.html
    M Source/WebCore/editing/Editor.cpp

  Log Message:
  -----------
  AutoFill unexpectedly scrolls to reveal text fields when inserting text
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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to