Bug 233939

Summary: Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting
Product: WebKit Reporter: Devin Rousso <hi>
Component: New BugsAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, berto, cdumez, cgarcia, esprehn+autocc, ews-watchlist, gustavo, hi, japhet, kangil.han, megan_gardner, mifenton, thorton, tsavell, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 191379    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Devin Rousso 2021-12-07 10:57:38 PST
.
Comment 1 Devin Rousso 2021-12-07 11:58:33 PST
Created attachment 446217 [details]
Patch
Comment 2 EWS Watchlist 2021-12-07 11:59:29 PST Comment hidden (obsolete)
Comment 3 Wenson Hsieh 2021-12-07 12:25:39 PST
Comment on attachment 446217 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=446217&action=review

> Source/WebCore/page/Frame.h:179
> +    bool requestDOMPasteAccess(DOMPasteAccessCategory);

Could we make this default to `DOMPasteAccessCategory::General`?
Comment 4 Devin Rousso 2021-12-07 12:27:46 PST
Comment on attachment 446217 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=446217&action=review

>> Source/WebCore/page/Frame.h:179
>> +    bool requestDOMPasteAccess(DOMPasteAccessCategory);
> 
> Could we make this default to `DOMPasteAccessCategory::General`?

Sure.  I kinda like the explicit-ness of having the callsite know exactly which category they're asking for, but I can also see the benefit in having `General` be the default.
Comment 5 Devin Rousso 2021-12-07 12:44:51 PST
Created attachment 446222 [details]
Patch
Comment 6 EWS 2021-12-07 16:56:23 PST
Committed r286632 (244945@main): <https://commits.webkit.org/244945@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446222 [details].
Comment 7 Radar WebKit Bug Importer 2021-12-07 16:57:24 PST
<rdar://problem/86183512>
Comment 8 Truitt Savell 2021-12-08 10:06:07 PST
It looks like the changes in https://trac.webkit.org/changeset/286632/webkit

broke 3 pasteboard tests on iOS 15 

editing/pasteboard/dom-paste/dom-paste-confirmation.html
editing/pasteboard/dom-paste/dom-paste-consecutive-confirmations.html
editing/pasteboard/dom-paste/dom-paste-requires-user-gesture.html

tracking in https://bugs.webkit.org/show_bug.cgi?id=234014
Comment 9 Truitt Savell 2021-12-08 12:35:10 PST
Reverted r286632 for reason:

Broke 3 tests on iOS

Committed r286705 (244984@trunk): <https://commits.webkit.org/244984@trunk>
Comment 10 Devin Rousso 2021-12-08 19:33:41 PST
Created attachment 446487 [details]
Patch

fix mistake in `-[WKContentView pasteForWebView:]`
Comment 11 EWS 2021-12-09 19:10:09 PST
Committed r286825 (245059@main): <https://commits.webkit.org/245059@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446487 [details].