W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2014

Transforming DataTransfer.setData HTML content

From: Alexey Proskuryakov <ap@webkit.org>
Date: Fri, 28 Feb 2014 13:43:53 -0800
Message-id: <77D8DA97-99BD-4BBC-BD19-6BD1DDFE1225@webkit.org>
To: WebApps WG <public-webapps@w3.org>

Safari, Firefox and Chrome all have different behavior when handling a call like event.clipboardData.setData("text/html", "text"):

Safari puts "text" on the pasteboard.
Firefox puts <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>text</body></html>
Chrome puts <meta charset='utf-8'>text

Is there any provision in any applicable spec that allows for such transformation? From what I could find, Safari behavior is the only one allowed. Did I miss something? Should the specs be changed?

Note that Firefox and Chrome implementations appear to be fairly naive. So Firefox for example can end up with something like this when trying to repair the string:

<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body><meta charset='us-ascii'><body>text</body></html></body></html>

- WBR, Alexey Proskuryakov
Received on Friday, 28 February 2014 21:44:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:22 UTC