Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 92b7d28fcfc3de2f1074ea2b315b44bec4a77690
https://github.com/WebKit/WebKit/commit/92b7d28fcfc3de2f1074ea2b315b44bec4a77690
Author: Brady Eidson <[email protected]>
Date: 2026-02-11 (Wed, 11 Feb 2026)
Changed paths:
M Source/WebKit/Shared/API/APIObject.h
M Source/WebKit/Shared/API/Cocoa/WebKit.h
M Source/WebKit/Shared/Cocoa/APIObject.mm
M Source/WebKit/Sources.txt
M Source/WebKit/SourcesCocoa.txt
A Source/WebKit/UIProcess/API/APIFormInfo.cpp
A Source/WebKit/UIProcess/API/APIFormInfo.h
A Source/WebKit/UIProcess/API/Cocoa/WKFormInfo.h
A Source/WebKit/UIProcess/API/Cocoa/WKFormInfo.mm
A Source/WebKit/UIProcess/API/Cocoa/WKFormInfoInternal.h
M Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
A Source/WebKit/UIProcess/API/Swift/WebPage+FormInfo.swift
M Source/WebKit/UIProcess/API/Swift/WebPage+NavigationDeciding.swift
M Source/WebKit/UIProcess/Cocoa/WKNavigationDelegateAdapter.swift
M Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm
M Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h
M Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm
Log Message:
-----------
Add `willSubmitForm` delegate API
rdar://170100052
https://bugs.webkit.org/show_bug.cgi?id=307517
Reviewed by Aditya Keerthi.
In its SPI form, `willSubmitForm` exists on the `_WKInputDelegate`
Form submission is much more a navigation concept, so lets put it there for the
API promotion.
Additionally, instead of exposing arguments piecemeal, let's add a `WKFormInfo`
container to
encapsulate it all.
Tests: Tools/TestWebKitAPI/Tests/WebKit Swift/WebPageTests.swift
Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm
Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h
Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm
* Source/WebKit/Shared/API/APIObject.h:
* Source/WebKit/Shared/API/Cocoa/WebKit.h:
* Source/WebKit/Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* Source/WebKit/Sources.txt:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/API/APIFormInfo.cpp: Added.
(API::FormInfo::FormInfo):
(API::FormInfo::~FormInfo):
(API::FormInfo::frame const):
(API::FormInfo::sourceFrame const):
(API::FormInfo::submissionURL const):
(API::FormInfo::httpMethod const):
(API::FormInfo::formValues const):
* Source/WebKit/UIProcess/API/APIFormInfo.h: Added.
* Source/WebKit/UIProcess/API/Cocoa/WKFormInfo.h: Added.
* Source/WebKit/UIProcess/API/Cocoa/WKFormInfo.mm: Added.
(protectedFormInfo):
(-[WKFormInfo frame]):
(-[WKFormInfo sourceFrame]):
(-[WKFormInfo submissionURL]):
(-[WKFormInfo httpMethod]):
(-[WKFormInfo formValues]):
(-[WKFormInfo _apiObject]):
* Source/WebKit/UIProcess/API/Cocoa/WKFormInfoInternal.h: Added.
* Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]):
* Source/WebKit/UIProcess/API/Swift/WebPage+NavigationDeciding.swift:
(NavigationDeciding.willSubmit(_:)):
(WebPage.willSubmit(_:)):
* Source/WebKit/UIProcess/Cocoa/WKNavigationDelegateAdapter.swift:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/SwiftBrowser/Source/ViewModel/NavigationDecider.swift:
(NavigationDecider.willSubmit(_:)):
* Tools/TestWebKitAPI/Tests/WebKit Swift/WebPageTests.swift:
(TestNavigationDecider.willSubmit(_:)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKInputDelegate.mm:
(TEST(WebKit, FormSubmissionNavigationAPI)):
* Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[TestNavigationDelegate webView:willSubmitForm:submissionHandler:]):
Canonical link: https://commits.webkit.org/307307@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications