Re: CSS and copy/pasting guidelines

On Wed, Mar 23, 2016 at 12:07 AM, Johannes Wilm
<johannes@fiduswriter.org> wrote:
>> The CSSWG discussed the effect of 'text-transform' on copy/pasted text
>> last year:
>>   https://lists.w3.org/Archives/Public/www-style/2015Apr/0282.html
>
> This sounds like this is about the plain text version of the copied
> contents. There it may make sense.
>
> Just to make sure: the html/richtext version should probably not do anything
> like this, as JS editor programmers will want o manipualte clipboard
> contents before the actual pasting is happening, cleaning it up in ways we
> cannot quite imagine here right now.
>
> Also, I wonder if this is something the clipboard API people have an opinion
> about (CC Hallvord).

I do have an opinion (FWIW), in short we should strive to not surprise
the user. If the user thinks s/he is copying upper-case text we should
paste upper-case text. So that's what I'd recommend doing for
plain-text. For rich text we should grab the original source code
including the case and preferably include a CSS fragment that does the
transform.

>> One principle that was proposed is that CSS in general shouldn't affect
>> copy/paste operations except for
>>   * generated content
>>   * the 'display' property

What about hidden? If I have this document:
<p style="visibility:hidden">Hello world!</p>
and do ctrl-a, ctrl-c - what should the plain text on the clipboard
be, if anything? Or opacity:0? This is perhaps best covered by people
spec'ing Selection-stuff though.
-Hallvord

Received on Thursday, 24 March 2016 21:28:02 UTC