Bug 191836

Summary: Content pasted from Excel does not preserve its structure
Product: WebKit Reporter: Comandeer <vepomoc>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: m.lewandowski, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Excel file used for tests none

Description Comandeer 2018-11-19 06:41:03 PST
Created attachment 355278 [details]
Excel file used for tests

Content from Excel pasted into [contenteditable] area has all metadata stripped off, making it impossible to detect the source of the content.

In Safari only the table element is available in DataTransfer object: https://gist.github.com/Comandeer/e0226ec9908a6a1fdf9b0204eacfa84f
In case of Firefox and Chrome, the whole structure of HTML is preserved: https://gist.github.com/Comandeer/8909ffa0c93caadc88220f91ab72ad88

As it can be seen, Chrome and Firefox gives access to the whole HTML document, allowing to fetch metadata from its head section. Safari however gives access only to body section, which disables the ability to fetch useful metadata (e.g. about the generator of content or the author) and additional styles.
Comment 1 Radar WebKit Bug Importer 2018-11-19 17:43:20 PST
<rdar://problem/46175988>
Comment 2 Ryosuke Niwa 2019-08-10 01:05:19 PDT
This is intentional sanitization. It's not safe in terms of security & privacy to expose raw clipboard content put forth by cross origin websites or native applications:
https://webkit.org/blog/8170/clipboard-api-improvements/