"text/html" data is not exposed when dragging and dropping across origins
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2017 07:14:29 +0000 (07:14 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2017 07:14:29 +0000 (07:14 +0000)
commit05d2ad6a3c1701b8d083499c750eb0ba4d57af48
tree7741e91cb99e79343546d34663650ea664e21f08
parent542b39d3cc975ad0ba212cd3d3f0a3e6f228365e
"text/html" data is not exposed when dragging and dropping across origins
https://bugs.webkit.org/show_bug.cgi?id=178253
<rdar://problem/34971203>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Minor tweak to DataTransfer::setDataFromItemList to allow "text/html" written from bindings to transfer across
origins without requiring a sanitized representation. Currently, sanitizedData is null, which limits "text/html"
to being treated as custom data, inaccessible across origins. We should instead treat markup supplied via
bindings the same way as we do "text/plain" supplied via bindings.

Modified Tests: editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html
                editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDataFromItemList):

LayoutTests:

Renames some existing layout tests, and also augments two tests to verify that "text/html" is preserved when
copying and dragging across origins that don't match.

* TestExpectations:
* editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-expected.txt: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-expected.txt.
* editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-origin-expected.txt: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin-expected.txt.
* editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-origin.html: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin.html.
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin-expected.txt: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin-expected.txt.
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin.html.
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin-expected.txt: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin-expected.txt.
* editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html: Renamed from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin.html.
* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-expected.txt [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-expected.txt with 100% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-origin-expected.txt [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin-expected.txt with 100% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-malformed-url-in-null-origin.html [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin.html with 100% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin-expected.txt [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin-expected.txt with 69% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin.html with 84% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin-expected.txt [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin-expected.txt with 52% similarity]
LayoutTests/editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html [moved from LayoutTests/editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin.html with 85% similarity]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/DataTransfer.cpp