DataTransfer.items does not contain items for custom types supplied via add or setData. This is not a major issue if there are no files in the DataTransfer, since the page can use DataTransfer.types and DataTransfer.getData to retrieve custom type data. But if there are files, we'll report only ["Files"] for DataTransfer.types, and not expose custom data in the DataTransferItemList. This behavior diverges from both Chrome (61.0) and FireFox (56.0).
Created attachment 323115 [details] Patch
Comment on attachment 323115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323115&action=review > Source/WebCore/dom/DataTransfer.cpp:145 > + auto lowercaseType = type.stripWhiteSpace().convertToASCIILowercase(); It is probably not right to use stringWhiteSpace here; that function uses the Unicode definition of whitespace, not the one that we’d normally use in HTML. Instead we would normally use stripLeadingAndTrailingHTMLSpaces. > Source/WebCore/dom/DataTransfer.cpp:146 > + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(lowercaseType)) It would be nice to have a named function for this test that we do in three different places in this patch.
Comment on attachment 323115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323115&action=review >> Source/WebCore/dom/DataTransfer.cpp:145 >> + auto lowercaseType = type.stripWhiteSpace().convertToASCIILowercase(); > > It is probably not right to use stringWhiteSpace here; that function uses the Unicode definition of whitespace, not the one that we’d normally use in HTML. Instead we would normally use stripLeadingAndTrailingHTMLSpaces. Fixed. I also adjusted normalizeTypes() to do the same. >> Source/WebCore/dom/DataTransfer.cpp:146 >> + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(lowercaseType)) > > It would be nice to have a named function for this test that we do in three different places in this patch. Sounds good!
Created attachment 323128 [details] Wait for EWS
Comment on attachment 323128 [details] Wait for EWS Attachment 323128 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4794263 New failing tests: editing/pasteboard/data-transfer-get-data-non-normalized-types.html
Created attachment 323138 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 323139 [details] Fix test expectation
Comment on attachment 323139 [details] Fix test expectation Clearing flags on attachment: 323139 Committed r223034: <http://trac.webkit.org/changeset/223034>
<rdar://problem/34877586>