Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 87bc3a99dc381b20fe1b6839f97d9ca3d8178122
https://github.com/WebKit/WebKit/commit/87bc3a99dc381b20fe1b6839f97d9ca3d8178122
Author: Wenson Hsieh <[email protected]>
Date: 2026-04-06 (Mon, 06 Apr 2026)
Changed paths:
M Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
M Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp
M Source/WebCore/dom/Event.cpp
M Source/WebCore/dom/Event.h
M Source/WebCore/dom/Event.idl
M Source/WebCore/dom/EventInit.h
M Source/WebCore/dom/EventInit.idl
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UserContentController.mm
Log Message:
-----------
Add a way for injected scripts with the AutoFill content world to dispatch
events that are trusted only for bindings
https://bugs.webkit.org/show_bug.cgi?id=311538
rdar://174129268
Reviewed by Ryosuke Niwa and Abrar Rahman Protyasha.
Currently, AutoFill dispatches synthetic key events through injected JavaScript
when filling text.
These key events are untrusted; some websites detect this, and prevent login.
To improve compatibility with these websites, we add a way for clients (exposed
only under the
AutoFill script world, for now) to create DOM events that are trusted only from
the perspective of
bindings code, but remain untrusted from the perspective of the engine.
Test: WKUserContentController.DispatchTrustedEventForAutoFill
* Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
Rebaseline bindings generation tests.
* Source/WebCore/dom/Event.cpp:
* Source/WebCore/dom/Event.h:
(WebCore::Event::isTrustedForBindings const):
Split out `isTrusted` into `isTrustedForBindings` (which honors the new flag,
and is only accessed
via script), and `isTrusted` (which the engine continues to use, and which only
honors the true
`m_isTrusted` state).
* Source/WebCore/dom/Event.idl:
* Source/WebCore/dom/EventInit.h:
* Source/WebCore/dom/EventInit.idl:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UserContentController.mm:
(TEST(WKUserContentController, DispatchTrustedEventForAutoFill)):
Canonical link: https://commits.webkit.org/310673@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications