HTML file input elements do not support file extensions in the "accept" attribute
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Aug 2017 17:38:57 +0000 (17:38 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Aug 2017 17:38:57 +0000 (17:38 +0000)
commitad3ac7f4cc8853b102741a86ad96d48f294f8457
tree30c1b08c74a12842aaff5ee2e7f2a592d73c658f
parente2fa171dfffba18141c11f097994cd9b5461f82f
HTML file input elements do not support file extensions in the "accept" attribute
https://bugs.webkit.org/show_bug.cgi?id=95698
<rdar://problem/12231850>

Reviewed by Darin Adler.

Source/WebCore:

Serialize the accepted file extensions so they can be accessed in the UI process.

* platform/FileChooser.h:
* platform/FileChooser.cpp:
(WebCore::FileChooser::invalidate): Modernize.
(WebCore::FileChooserSettings::acceptTypes const): Deleted.
This is dead code, it was only used by Chromium.

Source/WebKit:

Plumb accepted file extensions out to the C API.
The Cocoa API will be improved in a later patch.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FileChooserSettings>::encode):
(IPC::ArgumentCoder<FileChooserSettings>::decode):
* UIProcess/API/APIOpenPanelParameters.cpp:
(API::OpenPanelParameters::acceptFileExtensions const):
* UIProcess/API/APIOpenPanelParameters.h:
* UIProcess/API/C/WKOpenPanelParametersRef.cpp:
(WKOpenPanelParametersCopyAcceptedFileExtensions):
* UIProcess/API/C/WKOpenPanelParametersRef.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/FileChooser.cpp
Source/WebCore/platform/FileChooser.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/UIProcess/API/APIOpenPanelParameters.cpp
Source/WebKit/UIProcess/API/APIOpenPanelParameters.h
Source/WebKit/UIProcess/API/C/WKOpenPanelParametersRef.cpp
Source/WebKit/UIProcess/API/C/WKOpenPanelParametersRef.h