WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 178016
DataTransfer.items does not contain items for custom types supplied via add or setData
https://bugs.webkit.org/show_bug.cgi?id=178016
Summary
DataTransfer.items does not contain items for custom types supplied via add o...
Wenson Hsieh
Reported
2017-10-06 10:24:46 PDT
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).
Attachments
Patch
(22.06 KB, patch)
2017-10-07 19:43 PDT
,
Wenson Hsieh
darin
: review+
Details
Formatted Diff
Diff
Wait for EWS
(25.22 KB, patch)
2017-10-08 01:25 PDT
,
Wenson Hsieh
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-elcapitan
(1.29 MB, application/zip)
2017-10-08 13:28 PDT
,
Build Bot
no flags
Details
Fix test expectation
(26.03 KB, patch)
2017-10-08 13:47 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2017-10-07 19:43:00 PDT
Created
attachment 323115
[details]
Patch
Darin Adler
Comment 2
2017-10-07 23:45:28 PDT
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.
Wenson Hsieh
Comment 3
2017-10-08 01:25:43 PDT
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!
Wenson Hsieh
Comment 4
2017-10-08 01:25:59 PDT
Created
attachment 323128
[details]
Wait for EWS
Build Bot
Comment 5
2017-10-08 13:28:03 PDT
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
Build Bot
Comment 6
2017-10-08 13:28:04 PDT
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
Wenson Hsieh
Comment 7
2017-10-08 13:47:22 PDT
Created
attachment 323139
[details]
Fix test expectation
WebKit Commit Bot
Comment 8
2017-10-08 14:58:32 PDT
Comment on
attachment 323139
[details]
Fix test expectation Clearing flags on attachment: 323139 Committed
r223034
: <
http://trac.webkit.org/changeset/223034
>
Radar WebKit Bug Importer
Comment 9
2017-10-08 17:37:24 PDT
<
rdar://problem/34877586
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug