Re: CSS Generated content selection

On Sun, 22 Apr 2007, Yahia wrote:

> When testing some content generating via CSS within HTML documents, I remark 
> that Opera gives the opportunity to select the generated text (such as 
> quotation marks enclosing <q> as a basic example), while Firefox disallows 
> selecting it, like it isn't part of the document.

That's an interesting and important observation. Thanks!

> Considering this, when one copies the text of a Web document (using Firefox) 
> and pastes it into a word processor, CSS-generated quotes, sub-quotes, 
> counters, etc., will be lost.

Not necessarily. It depends on how the copying is implemented. Copying via 
Windows clipboard tends to transfer much of the formatting, often too much 
(unless the user knows how to paste as plain text). But since MSIE does 
not support generated content, I wouldn't expect it to get transferred 
when copying to MS Word.

> A text that is around quotes while made without them as part of the text is a 
> huge mistake, and the user won't probably notice that, so the content he 
> copied in his text application isn't exactly the same as the original (is 
> flawed in the case of quotes).

Quite right, but then the question arises whether it was a good idea to 
use generated content for the quotes and not include them into content 
proper. After all, generated content is lost whenever the page is viewed 
on any version of MSIE, or on any browser with CSS disabled, etc.

> Which browser's behavior is correct? Firefox or Opera's? What is clear is 
> that for the case of using (or copy-and-pasting of content from) Web 
> documents, Opera browser does the right job.
> I would like to know if the CSS specifications say something about this.

It's not clear at all what is "the right job" here. It depends on the 
purposes of the user and the context.

Generally, CSS specifications say nothing about things like copy and 
paste. It is a system-dependent thing and deals with the effect of CSS on 
matters external to CSS. It is comparable to preserving part of the 
styling, possibly converting CSS code to software-dependent style 
settings, when copying and pasting or when e.g. opening an HTML document 
with associated CSS code in a word processor. CSS comes into the picture 
if a word processor purports to support CSS, as it could.

We may have different views on what might be practical. I think users 
should have control on what happens in copy & paste, when using it in a 
context where formatting _could_ be transferred. Generated content is 
special in the sense that it _could_ be transferred even when the 
destination is plain text. But on practical grounds, is it reasonable to 
expect that characters in generated content would be preserved when almost 
all formatting, including even italics and font size variation, is 
inevitably lost?

In any case, I don't think it would belong to CSS specifications to define 
such things. They might be defined in adjunctory documents, which might be 
specifications or (more probably) informal notes.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Sunday, 22 April 2007 08:20:22 UTC