[webkit-changes] [WebKit/WebKit] 059f80: Implement cancel event on <input type=file>

Richard Robinson noreply at github.com
Tue Oct 11 12:08:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 059f8069cb4a83b08a89b8b2ae02d9b82d8c5fd1
      https://github.com/WebKit/WebKit/commit/059f8069cb4a83b08a89b8b2ae02d9b82d8c5fd1
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2022-10-11 (Tue, 11 Oct 2022)

  Changed paths:
    M Source/WebCore/html/FileInputType.cpp
    M Source/WebCore/html/FileInputType.h
    M Source/WebCore/html/HTMLFormControlElement.cpp
    M Source/WebCore/html/HTMLFormControlElement.h
    M Source/WebCore/platform/FileChooser.cpp
    M Source/WebCore/platform/FileChooser.h
    M Source/WebKit/WebProcess/WebPage/WebOpenPanelResultListener.cpp
    M Source/WebKit/WebProcess/WebPage/WebOpenPanelResultListener.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/RunOpenPanel.mm

  Log Message:
  -----------
  Implement cancel event on <input type=file>
https://bugs.webkit.org/show_bug.cgi?id=227799
rdar://80340803

Reviewed by Aditya Keerthi.

This PR implements the "Add a "cancel" event for when file upload selection is unchanged"
behavior.

The `cancel` event is now fired when:
- The file picker is dismissed
- The selected files are the same as those currently selected

Spec: https://html.spec.whatwg.org/multipage/input.html#show-the-picker,-if-applicable

* Source/WebCore/html/FileInputType.cpp:
(WebCore::FileInputType::setFiles):
(WebCore::FileInputType::fileChoosingCancelled):
* Source/WebCore/html/FileInputType.h:
* Source/WebCore/platform/FileChooser.cpp:
(WebCore::FileChooser::cancelFileChoosing):
* Source/WebCore/platform/FileChooser.h:
* Source/WebKit/WebProcess/WebPage/WebOpenPanelResultListener.cpp:
(WebKit::WebOpenPanelResultListener::didCancelFileChoosing):
* Source/WebKit/WebProcess/WebPage/WebOpenPanelResultListener.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCancelForOpenPanel):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/RunOpenPanel.mm:
(-[FileInputTypeCancelEventUIDelegate webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list