Bug 203168

Summary: [Clipboard API] Implement ClipboardItem.getType() for platform clipboard items
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cdumez, commit-queue, dbates, esprehn+autocc, ews-watchlist, kangil.han, megan_gardner, rniwa, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Fix Win/GTK/WPE
none
Fix & new layout test none

Wenson Hsieh
Reported 2019-10-18 15:54:48 PDT
ClipboardItem.getType returns a promise that resolves to a Blob containing data for the given type.
Attachments
Patch (47.53 KB, patch)
2019-10-19 17:49 PDT, Wenson Hsieh
no flags
Fix Win/GTK/WPE (47.42 KB, patch)
2019-10-19 17:58 PDT, Wenson Hsieh
no flags
Fix & new layout test (51.32 KB, patch)
2019-10-21 11:07 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-10-19 17:49:09 PDT Comment hidden (obsolete)
Wenson Hsieh
Comment 2 2019-10-19 17:58:27 PDT Comment hidden (obsolete)
Tim Horton
Comment 3 2019-10-21 10:29:07 PDT
Comment on attachment 381381 [details] Fix Win/GTK/WPE View in context: https://bugs.webkit.org/attachment.cgi?id=381381&action=review > Source/WebCore/Modules/async-clipboard/Clipboard.cpp:148 > + m_activeSession = WTF::nullopt; Why does trying to get the type of a non-active item clear the Clipboard's "active session"?
Wenson Hsieh
Comment 4 2019-10-21 10:37:24 PDT
Comment on attachment 381381 [details] Fix Win/GTK/WPE View in context: https://bugs.webkit.org/attachment.cgi?id=381381&action=review >> Source/WebCore/Modules/async-clipboard/Clipboard.cpp:148 >> + m_activeSession = WTF::nullopt; > > Why does trying to get the type of a non-active item clear the Clipboard's "active session"? Good catch! Yeah, this would mean that trying to fetch an invalid clipboard item’s data would cause currently valid items to become invalidated, which is wrong. Removed the `m_activeSession = WTF::nullopt;`; I will also add a new layout test to exercise this scenario.
Wenson Hsieh
Comment 5 2019-10-21 11:07:44 PDT
Created attachment 381419 [details] Fix & new layout test
WebKit Commit Bot
Comment 6 2019-10-21 13:20:01 PDT
Comment on attachment 381419 [details] Fix & new layout test Clearing flags on attachment: 381419 Committed r251377: <https://trac.webkit.org/changeset/251377>
WebKit Commit Bot
Comment 7 2019-10-21 13:20:03 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-10-21 13:21:21 PDT
Note You need to log in before you can comment on or make changes to this bug.