DataTransfer.items should contain text/html and text/uri-list
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2017 23:10:33 +0000 (23:10 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2017 23:10:33 +0000 (23:10 +0000)
commitace4751946b8eb38781e97c4d73326990a0a1826
treeac1de36ce0276e3ebdb6b12093339ff554098cf8
parent7671adac4ec98bc49a2e50c1c89df13aaaeeaa0b
DataTransfer.items should contain text/html and text/uri-list
https://bugs.webkit.org/show_bug.cgi?id=176772
<rdar://problem/34386899>

Reviewed by Darin Adler.

Source/WebCore:

Expose text/html and text/uri-list in dataTransfer.items.

Tests: editing/pasteboard/datatransfer-items-copy-html.html
       editing/pasteboard/datatransfer-items-copy-url.html

* dom/DataTransferItemList.cpp:
(WebCore::isSupportedType): Added both MIME types.
(WebCore::DataTransferItemList::add): Fixed the bug that new data transfer item was using
the original type string instead of the lowercased one.

LayoutTests:

Added tests for copying text/html and text/uri-list, and updated the existing test for
coping & pasting plain text to explicitly set only text/plain now that
the data transfer item list can contain HTML markup.

* editing/pasteboard/datatransfer-items-copy-html-expected.txt: Added.
* editing/pasteboard/datatransfer-items-copy-html.html: Added.
* editing/pasteboard/datatransfer-items-copy-url-expected.txt: Added.
* editing/pasteboard/datatransfer-items-copy-url.html: Added.
* editing/pasteboard/datatransfer-items-paste-plaintext.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/datatransfer-items-copy-html-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-items-copy-html.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-items-copy-url-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-items-copy-url.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-items-paste-plaintext.html
Source/WebCore/ChangeLog
Source/WebCore/dom/DataTransferItemList.cpp