-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a clipboard media type #648
Comments
I'm worried about |
Yes, that's a downside from a user point of view. Though web authors can already achieve copy protection via Sebastian |
As @Crissov commented, this is highly likely to be abused. And as @smfr commented on a recent conference call, this would significantly complicate how implementations deal with copying to the clipboard, as they would have to do a dedicated layout pass, which they currently do not do. Besides, even if we do not have this in CSS, it should be doable in Javascript. I'd like to close this as WONTFIX. Is that OK with you? |
As I said, a similar way to copy-protect a page is already available via
The idea about the 'clipboard' media type could have been part of a larger discussion about specifying how implementations should deal with copying. (Currently they obviously differ a lot!) I'm not an implementer, but I would have assumed the technical part to be relatively easy, because the layout algorithm would mostly be the same as the one used for the screen or print layout. @fantasai in the minutes from 2016-10-26:
I assume UAs would only be required to change the default style sheet for this and the cascade would work the same as now.
I still think it would be good to have a way to influence clipboard layout in some way, but I can understand your disagreement on the proposed 'clipboard' media type. Sebastian |
Well, on the one hand, you are right that code to do layout already exists. But that code does not get invoked when doing copy-paste operations today, and it would now need to. This would change a simple string manipulation operation into a much heaving operation doing selector matching, cascading, inheritance, style computation, and create a box tree separate from the one used for the page (since it has different styles), and then since you don't want to use the DOM as-is, you'd need some form of layout/paint... Moreover, you couldn't actually reuse the existing layout and paint part of the code, because you'd need to render to a string, which is a one dimensional thing, very different from the two 2 canvas CSS rendering operates in. For sure, rendering to a string is going to be much simpler than rendering to 2D, but that's still code that doesn't exist today that needs to be written. And then you have all sorts of weird questions. If part or all of the thing you have selected and are trying to copy is set to
I think this was a good instance of thinking out of the box to see if a different approach could get us somewhere. I'm glad we looked at it, but ultimately, it doesn't work out. |
Anyway, thank you for the consideration and the explanations! Sebastian |
It should be possible to style web contents differently when they are copied to the clipboard.
This would allow modifications like e.g. resizing or hiding images when copied, or removing some styling which should only be shown within the browser, or display some copyright information on copied text.
Example:
To be able to style different clipboard formats individually,
clipboard
may be changed to a function likeclipboard(<mime-type>)
:This idea rose in the issue about the copy/paste behavior with
text-transform
.Sebastian
The text was updated successfully, but these errors were encountered: