Re: [css-content] Request for note regarding selection, search, and accessibility of generated content

> On 23 Nov 2015, at 21:32, Michiel Bijl <michiel@agosto.nl> wrote:
> 
> Hi Florian,
> 
>> On 23 Nov 2015, at 03:37, Florian Rivoal <florian@rivoal.net <mailto:florian@rivoal.net>> wrote:
>> 
>> By default (as per the legacy behavior), generated content in pseudo elements is not searchable/copyable/selectable. However, using the user-select property on the pseudos could make them searchable/copyable/selectable.
>> 
>> - Florian
> 
> That doesn’t sound like a viable solution; it’s essentially the same as having to add box-sizing: border-box; to everything.

No, because it's not supposed to be applied to everything.

> Are there cases where it is preferable the user cannot select text in generated content? And do those outnumber the cases where it’s preferable they can select it?

Yes, there are cases where it is preferable that the user cannot select or copy text in the generated content. All decorative uses of generated content fall into this case. And we've been strongly (with more or less success) encouraging authors to avoid using generated content for other purposes than decorative ones, since it harms the semantics of the document, and therefore accessibility. Whether or not decorative uses outnumber the non decorative ones is probably the wrong question. Since non selectability is the legacy behavior, the question is whether decorative use is common enough that changing to selectable by default would break a significant number of previously working sites. And I think it is.

Besides, while we recognize that people use generated content for non decorative reasons as well, and while we want to make it possible to have these use cases work well, we don't want to encourage people to put things in generated content when it would have been practical to put them in the document. So making the document work better than generated content by default is a feature.

 - Florian

Received on Tuesday, 24 November 2015 00:48:00 UTC