Bug 209531

Summary: Avoid querying pasteboard strings while dragging content over a potential drop target
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, megan_gardner, rniwa, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: DoNotImportToRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+
Patch for landing none

Description Wenson Hsieh 2020-03-24 22:51:15 PDT
Refactor some code running in the web process, such that it doesn’t need to ask for pasteboard data prior to drop (or paste).
Comment 1 Wenson Hsieh 2020-03-24 22:51:49 PDT
Work towards <rdar://problem/59611585>
Comment 2 Wenson Hsieh 2020-03-24 23:04:23 PDT
Created attachment 394471 [details]
Patch
Comment 3 Tim Horton 2020-03-24 23:12:30 PDT
Comment on attachment 394471 [details]
Patch

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

> Source/WebCore/ChangeLog:15
> +        This is incompatible with some changes in the near future which will prevent the web content process from any
> +        reading data from the pasteboard, if a paste or drop action has not yet been performed. To address this issue,

"any reading data"?
Comment 4 Ryosuke Niwa 2020-03-24 23:44:19 PDT
Comment on attachment 394471 [details]
Patch

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

> Source/WebCore/platform/PlatformPasteboard.h:102
>      WEBCORE_EXPORT Vector<String> typesSafeForDOMToReadAndWrite(const String& origin) const;
> +    WEBCORE_EXPORT bool containsDOMSafeStringForType(const String&) const;

For consistency, I suggest we call this containsStringSafeForDOMToReadForType
Comment 5 Wenson Hsieh 2020-03-25 07:19:44 PDT
Comment on attachment 394471 [details]
Patch

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

>> Source/WebCore/ChangeLog:15
>> +        reading data from the pasteboard, if a paste or drop action has not yet been performed. To address this issue,
> 
> "any reading data"?

Oops — fixed!

>> Source/WebCore/platform/PlatformPasteboard.h:102
>> +    WEBCORE_EXPORT bool containsDOMSafeStringForType(const String&) const;
> 
> For consistency, I suggest we call this containsStringSafeForDOMToReadForType

Sounds good — changed to containsStringSafeForDOMToReadForType.
Comment 6 Wenson Hsieh 2020-03-25 07:41:43 PDT
Created attachment 394494 [details]
Patch for landing
Comment 7 EWS 2020-03-25 08:05:58 PDT
Committed r258980: <https://trac.webkit.org/changeset/258980>

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