3 ms·
The source would know how to render it and could provide the OS with some kind representation when asked (basically drawing the contents of the preview window).
by chmod775 7y ago
The source would know how to render it and could provide the OS with some kind representation when asked (basically drawing the contents of the preview window).
- jameshart 7y agoThe suggestion to have the OS responsible for rendering is precisely to deal with the case of an untrusted source, Asking that source to tell you 'what did you really put on the clipboard?' is not going to get you a better answer.
- chmod775 7y ago> The suggestion to have the OS responsible for rendering is precisely to deal with the case of an untrusted source Your web browser is an untrusted source? You might be confusing the browser for the sites it displays. Browser vendors are unlikely to fight you trying to make copy & paste a better experience, they just lack ideas or a good solution that works across application/OS boundaries. In any case the OS wouldn't need the web browser to tell it how to display the text representation.
- tjoff 7y agoThe clipboard contains multiple formats. So if you paste a couple of excel cells in another sheet you get what you expect. But if you paste it into notepad you get a text representation. These do not need to contain the same thing, so the OS would need to preview all different formats and the user would have to manually inspect each of them.
- chmod775 7y ago> These do not need to contain the same thing, so the OS would need to preview all different formats and the user would have to manually inspect each of them. No. It just needs to preview the one that would be used by the destination. You could pretty much model this like existing drag & drop APIs, where whether a certain object is acceptable for "dropping" is communicated even before the user releases the mouse. In any case the OS doesn't need the application to tell it how to render the basic text representation.
- tjoff 7y agoYou don't know that until you paste, which might be a while after the copy and you also don't have the source available anymore in case it shows up weird, or you don't remember exactly what it was, or have it to compare to. This sounds quite cumbersome even for the techie. The basic text representation isn't enough. Maybe the text representation is correct but the html one embeds some javascript? How are you going to render that?