Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0fc7a94ca7d2679f71e24d6182f0abc59820c105
https://github.com/WebKit/WebKit/commit/0fc7a94ca7d2679f71e24d6182f0abc59820c105
Author: Ben Nham <[email protected]>
Date: 2025-12-01 (Mon, 01 Dec 2025)
Changed paths:
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Event.h
M Source/WebCore/dom/EventNames.json
M Source/WebCore/dom/Node.cpp
M Source/WebCore/dom/Node.h
M Source/WebCore/html/SubmitEvent.cpp
M Source/WebCore/html/SubmitEvent.h
M Source/WebCore/html/TextFieldInputType.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
Log Message:
-----------
Add a composed submit event
https://bugs.webkit.org/show_bug.cgi?id=303019
rdar://problem/165291067
Reviewed by Ryosuke Niwa and Sihui Liu.
Some use cases want to be able to register a single top-level submit event
listener that gets called
back for form submissions whether or not they happen in a shadow tree. Add a
composed `webkitsubmit`
event for this use case. It behaves exactly the same as the submit event, but
it is composed so it
will propagate out of the shadow tree.
Currently this event is only enabled for the autofill world.
As part of this change, also make `webkitautofillrequest` and
`webkitassociateformcontrols` composed
events so that they can also propagate out of the shadow tree.
Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::didAssociateFormControlsTimerFired):
* Source/WebCore/dom/Event.h:
(WebCore::Event::isSubmitEvent const):
* Source/WebCore/dom/EventNames.json:
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::dispatchWebKitSubmitEvent):
(WebCore::Node::defaultEventHandler):
* Source/WebCore/dom/Node.h:
* Source/WebCore/html/SubmitEvent.cpp:
(WebCore::SubmitEvent::isSubmitEvent const):
* Source/WebCore/html/SubmitEvent.h:
* Source/WebCore/html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST(WKUserContentController, DidAssociateFormControlsFromShadowTree)):
(TEST(WKUserContentController, AllowElementUserInfoFromShadowTree)):
(TEST(WKUserContentController, WebKitSubmitEvent)):
Canonical link: https://commits.webkit.org/303703@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications