Bug 190270

Summary: [Cocoa] Let clients specify an NSFileWrapper subclass to be used for _WKAttachment
Product: WebKit Reporter: mitz
Component: HTML EditingAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, Hironori.Fujii, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Add _attachmentFileWrapperClass property to WKWebViewConfiguration wenson_hsieh: review+

mitz
Reported 2018-10-03 18:17:58 PDT
It’s useful if WebKit can make file wrappers of a client-specified subclass of NSFileWrapper. Patch forthcoming.
Attachments
Add _attachmentFileWrapperClass property to WKWebViewConfiguration (10.64 KB, patch)
2018-10-03 18:22 PDT, mitz
wenson_hsieh: review+
mitz
Comment 1 2018-10-03 18:22:56 PDT
Created attachment 351571 [details] Add _attachmentFileWrapperClass property to WKWebViewConfiguration
EWS Watchlist
Comment 2 2018-10-03 18:24:24 PDT
Attachment 351571 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1458: Extra space in capture list. [whitespace/brackets] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1459: Extra space in capture list. [whitespace/brackets] [4] Total errors found: 2 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Wenson Hsieh
Comment 3 2018-10-03 18:27:30 PDT
Comment on attachment 351571 [details] Add _attachmentFileWrapperClass property to WKWebViewConfiguration View in context: https://bugs.webkit.org/attachment.cgi?id=351571&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1456 > + NSPasteboard *pasteboard = NSPasteboard.generalPasteboard; This is in cross-platform code! Could you just use one of the platform helper functions to write something to the pasteboard (e.g. platformCopyPNG(), platformCopyRichTextWithMultipleAttachments(), etc.) so we can run this on iOS as well?
mitz
Comment 4 2018-10-03 18:42:33 PDT
(In reply to Wenson Hsieh from comment #3) > Comment on attachment 351571 [details] > Add _attachmentFileWrapperClass property to WKWebViewConfiguration > > View in context: > https://bugs.webkit.org/attachment.cgi?id=351571&action=review > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1456 > > + NSPasteboard *pasteboard = NSPasteboard.generalPasteboard; > > This is in cross-platform code! Could you just use one of the platform > helper functions to write something to the pasteboard (e.g. > platformCopyPNG(), platformCopyRichTextWithMultipleAttachments(), etc.) so > we can run this on iOS as well? Sure! For some reason I confused myself into thinking none of those would produce a single _WKAttachment upon paste.
mitz
Comment 5 2018-10-03 18:42:55 PDT
I also need to fix the !WK_API_ENABLED build.
mitz
Comment 6 2018-10-03 19:04:24 PDT
Radar WebKit Bug Importer
Comment 7 2018-10-03 19:05:29 PDT
Fujii Hironori
Comment 8 2018-10-03 21:50:32 PDT
WinCairo port gets broken. https://build.webkit.org/builders/WinCairo%2064-bit%20WKL%20Release%20%28Build%29/builds/3750 > [6/44] Building CXX object Source\WebKit\CMakeFiles\WebKit.dir\UIProcess\win\WebPopupMenuProxyWin.cpp.obj > FAILED: Source/WebKit/CMakeFiles/WebKit.dir/UIProcess/win/WebPopupMenuProxyWin.cpp.obj > "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\Hostx64\x64\cl.exe" (...) -c ..\..\Source\WebKit\UIProcess\win\WebPopupMenuProxyWin.cpp > C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebKit\UIProcess\PageClient.h(447): error C2143: syntax error: missing ';' before '*' > C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebKit\UIProcess\PageClient.h(447): error C2433: 'WebKit::PageClient::NSFileWrapper': 'virtual' not permitted on data declarations > C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebKit\UIProcess\PageClient.h(447): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int > C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebKit\UIProcess\PageClient.h(447): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
mitz
Comment 9 2018-10-03 21:55:07 PDT
(In reply to Fujii Hironori from comment #8) > WinCairo port gets broken. Sorry about that! I’ll fix it right away.
mitz
Comment 10 2018-10-03 21:57:56 PDT
(In reply to mitz from comment #9) > (In reply to Fujii Hironori from comment #8) > > WinCairo port gets broken. > > Sorry about that! I’ll fix it right away. Tried to fix it in <https://trac.webkit.org/r236826>.
Note You need to log in before you can comment on or make changes to this bug.