Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9b6f2b40feaedb2611696525b652acf8572a6831
https://github.com/WebKit/WebKit/commit/9b6f2b40feaedb2611696525b652acf8572a6831
Author: Aditya Keerthi <[email protected]>
Date: 2025-10-17 (Fri, 17 Oct 2025)
Changed paths:
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-camera-via-menu-expected.txt
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-camera-via-menu.html
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-expected.txt
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-via-menu-expected.txt
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-via-menu.html
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker.html
A LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-menu-expected.txt
A LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-menu.html
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-photo-picker-via-menu-expected.txt
A
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-photo-picker-via-menu.html
A LayoutTests/fast/forms/ios/resources/window-blur-focus-utils.js
M LayoutTests/platform/ios-18/TestExpectations
M LayoutTests/resources/ui-helper.js
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
M Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm
M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
M Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h
M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
M Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp
M Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h
M Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
Log Message:
-----------
[iOS] iCloud Drive: Backing out from “Take a photo/video” upload causes the
upload button to stop working
https://bugs.webkit.org/show_bug.cgi?id=300806
rdar://157789623
Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.
icloud.com disables their upload button when the file input is clicked, but only
re-enables the button when "focus" is dispatched on the window. The photo picker
and camera view do not take first responder from the content view, which means
that "blur" and "focus" events are not dispatched. In contrast, the document
picker
does take first responder. Additionally, the same issue is encountered when
showing the context menu for the file input and dismissing it without selecting
a
picker.
Fix by resigning and restoring first responder when the menu and/or picker are
presented/dismissed. This ensures "focus" and "blur" events are dispatched
correctly. The overall behavior now aligns with macOS and Android.
Add tests for various file picker scenarios:
1. Presenting and dismissing the menu without presenting any picker.
2. Presenting the menu and then using the document picker.
3. Presenting the menu and then using the photo picker.
4. Presenting the menu and then using the camera.
5. Presenting the document picker directly.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-camera-via-menu-expected.txt:
Added.
* LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-camera-via-menu.html:
Added.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-expected.txt:
Added.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-via-menu-expected.txt:
Added.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker-via-menu.html:
Added.
* LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-document-picker.html:
Added.
* LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-menu-expected.txt:
Added.
* LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-menu.html: Added.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-photo-picker-via-menu-expected.txt:
Added.
*
LayoutTests/fast/forms/ios/file-upload-panel-blur-focus-photo-picker-via-menu.html:
Added.
* LayoutTests/fast/forms/ios/resources/window-blur-focus-utils.js: Added.
(async waitForWindowBlur):
(async waitForWindowFocus):
* LayoutTests/platform/ios-18/TestExpectations:
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.waitForViewControllerToShow):
Add a helper to wait for view controller presentation.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView fileUploadPanelDidDismiss:]):
Restore first responder when the file upload flow is complete. This dispatches
"focus" on the window.
* Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel
contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
Implement the delegate method for context menu presentation, so that the first
responder can be resigned when the menu is presented.
Call `_didShowContextMenu` to facilitate testing.
(-[WKFileUploadPanel contextMenuInteraction:willEndForConfiguration:animator:]):
Call `_didDismissContextMenu` to facilitate testing.
(-[WKFileUploadPanel _presentFullscreenViewController:animated:):
If the content view is still the first responder when an actual picker is
presented, resign.
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
* Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp:
(WTR::UIScriptController::setDidPresentViewControllerCallback):
(WTR::UIScriptController::didPresentViewControllerCallback const):
* Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView resetInteractionCallbacks]):
(-[TestRunnerWKWebView _didPresentViewController:]):
* Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h:
* Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::setDidPresentViewControllerCallback):
Canonical link: https://commits.webkit.org/301721@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