Re: Transforming DataTransfer.setData HTML content

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

The clipboard event spec certainly doesn't handle this case. I had no idea some browsers had this quirky "convert-to-html" behaviour, and my first thought is that it looks sort of ugly and messy to do that..

On the other hand, I can imagine a sane-ish argument for, say, setData('text/html', 'foo & bar') actually placing 'foo & bar' on the clipboard..? Also, the Windows CF_HTML format AFAIK requires wrapping the text in a bit of markup with some "magic" HTML comments.

Anyway, I'd say the implementation should leave the data it gets from JS as-is as much as possible. Unless that turns out to be incompatible with other applications, say word processors and such on the receiving end..


Received on Monday, 3 March 2014 09:32:10 UTC