Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 590c0256ba490bfb57dd3fd7e8dc21712d41b3a9
      
https://github.com/WebKit/WebKit/commit/590c0256ba490bfb57dd3fd7e8dc21712d41b3a9
  Author: Ben Nham <[email protected]>
  Date:   2025-12-01 (Mon, 01 Dec 2025)

  Changed paths:
    M Source/WebCore/dom/EventNames.json
    M Source/WebCore/html/HTMLTextFormControlElement.cpp
    M Source/WebCore/html/HTMLTextFormControlElement.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
    M Tools/TestWebKitAPI/Tests/mac/KeyboardEventTests.mm

  Log Message:
  -----------
  Add an event that fires for user text input
https://bugs.webkit.org/show_bug.cgi?id=302969
rdar://problem/165226356

Reviewed by Per Arne Vollan.

Some use cases want an event that only fires when real user typing occurs (i.e. 
not synthetic
modifications to input or textarea via JS). Adding an event handler for the 
input event that checks
for isTrusted events mostly accomplishes this. But it still has some overhead 
that we don't want to
pay for (e.g. an untrusted click event on a checkbox causes a trusted input 
event to fire, which
then spuriously invokes the code that only cares about real user typing).

To help with this, add a webkitusertextinput event that only fires when real 
user typing occurs
which modifies a text field or text area. This is analogous to the behavior of 
the
textDidChangeInTextField and textDidChangeInTextArea APIs that we offer to the 
injected bundle.

For now, this event is only available to autofill worlds.

Test: Tools/TestWebKitAPI/Tests/mac/KeyboardEventTests.mm
* Source/WebCore/dom/EventNames.json:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::dispatchUserTextInputEvent):
* Source/WebCore/html/HTMLTextFormControlElement.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::textDidChangeInTextField):
(WebKit::WebEditorClient::textDidChangeInTextArea):
* Tools/TestWebKitAPI/Tests/mac/KeyboardEventTests.mm:
(TestWebKitAPI::TEST(KeyboardEventTests, UserTextInputEvent)):

Canonical link: https://commits.webkit.org/303685@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to