Bug 195053

Summary: [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, berto, cdumez, cgarcia, commit-queue, dbates, esprehn+autocc, ews-watchlist, gustavo, japhet, kangil.han, mcatanzaro, rniwa, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
First pass
none
Patch for EWS
none
Fix WPE build none

Wenson Hsieh
Reported 2019-02-26 10:20:15 PST
Attachments
First pass (66.71 KB, patch)
2019-02-26 13:03 PST, Wenson Hsieh
no flags
Patch for EWS (66.93 KB, patch)
2019-03-01 16:07 PST, Wenson Hsieh
no flags
Fix WPE build (66.96 KB, patch)
2019-03-01 18:39 PST, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-02-26 13:03:09 PST
Created attachment 363009 [details] First pass
EWS Watchlist
Comment 2 2019-02-26 13:05:06 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Wenson Hsieh
Comment 3 2019-02-26 13:10:04 PST
(In reply to Build Bot from comment #2) > Thanks for the patch. If this patch contains new public API please make sure > it follows the guidelines for new WebKit2 GTK+ API. See > http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API Doesn't seem relevant here, since the method is private.
Ryosuke Niwa
Comment 4 2019-03-01 14:00:54 PST
Comment on attachment 363009 [details] First pass View in context: https://bugs.webkit.org/attachment.cgi?id=363009&action=review r=me. Please be sure to fix WPE build failure before landing. > Source/WebCore/dom/DOMPasteAccess.h:28 > +#import <wtf/Forward.h> We should be using #include instead. That's why WPE isn't happy. > Source/WebCore/page/Frame.cpp:686 > + return response != DOMPasteAccessResponse::DeniedForGesture; I think we should use a switch and explicitly list all values. Otherwise, we could miss updating this location when we add a new kind of denial. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5032 > + NSIndexSet *indices = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [pasteboard numberOfItems])]; Use auto? > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5033 > + NSArray<NSData *> *allCustomData = [pasteboard dataForPasteboardType:@(WebCore::PasteboardCustomData::cocoaType()) inItemSet:indices]; Ditto. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5037 > + BOOL foundAtLeastOneMatchingIdentifier; Huh, does objective-C always initialize BOOL to NO?
Wenson Hsieh
Comment 5 2019-03-01 15:24:16 PST
Comment on attachment 363009 [details] First pass View in context: https://bugs.webkit.org/attachment.cgi?id=363009&action=review >> Source/WebCore/dom/DOMPasteAccess.h:28 >> +#import <wtf/Forward.h> > > We should be using #include instead. That's why WPE isn't happy. Indeed — fixed. >> Source/WebCore/page/Frame.cpp:686 >> + return response != DOMPasteAccessResponse::DeniedForGesture; > > I think we should use a switch and explicitly list all values. > Otherwise, we could miss updating this location when we add a new kind of denial. Good idea — changed to use switch case. >> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5032 >> + NSIndexSet *indices = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [pasteboard numberOfItems])]; > > Use auto? 👍 >> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5033 >> + NSArray<NSData *> *allCustomData = [pasteboard dataForPasteboardType:@(WebCore::PasteboardCustomData::cocoaType()) inItemSet:indices]; > > Ditto. 👍 >> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:5037 >> + BOOL foundAtLeastOneMatchingIdentifier; > > Huh, does objective-C always initialize BOOL to NO? Good catch — BOOL is only initialized to NO for instance variables! Changed this to be NO.
Wenson Hsieh
Comment 6 2019-03-01 16:07:16 PST
Created attachment 363387 [details] Patch for EWS
Wenson Hsieh
Comment 7 2019-03-01 18:39:43 PST
Created attachment 363396 [details] Fix WPE build
WebKit Commit Bot
Comment 8 2019-03-02 13:50:50 PST
Comment on attachment 363396 [details] Fix WPE build Clearing flags on attachment: 363396 Committed r242317: <https://trac.webkit.org/changeset/242317>
WebKit Commit Bot
Comment 9 2019-03-02 13:50:51 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.