W3C home > Mailing lists > Public > www-style@w3.org > April 2007

Re: CSS Generated content selection

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Tue, 24 Apr 2007 07:41:01 +0100
Message-ID: <462DA67D.2000104@googlemail.com>
To: Yahia <cyahia@gmail.com>
CC: Spartanicus <mk98762@gmail.com>, www-style@w3.org

I think the problem here boils down to the following:

1. Presentational effects are used to denote semantics in particular 
media. For example, a visual browser might put extra leading between 
paragraphs; a talking browser might put a long pause. Or, a visual 
browser might place quotation marks around a quotation; a talking 
browser might read it in a different voice to the main text. Without 
such presentational effects, human beings cannot extract the semantics 
of the document. (Quotes /are/ presentational, because they can be 
changed (e.g. single to double and back) according to the whims of 
different publishers without changing the essential content (the words). 
But just because they are presentational, does not mean their presence 
in visual media is unnecessary.)

2. Therefore when copying to text/plain, browsers must still communicate 
as much of the same semantics as is practical. Semantics are denoted in 
plain text by a whole series of "presentational" effects. e.g.:

 > block quotation
"inline quotation"
First paragraph

A new paragraph.

* bullet list item.

1. ordered list item.

/italic/

BOLD

Heading
=======

^superscript

Browsers need not use the particular set of presentational effects 
suggested through authorial CSS, both because content should not require 
them and because they may have no direct text/plain equivalent anyhow. 
But they must still use presentational effects of some sort.

3. There are conventional presentational effects for text/plain, but no 
authoritative specification.

4. Current copy and paste systems are extremely crude, such that they 
can't really handle conversions and choices between basic media types 
themselves. e.g. A really good text editor could offer to paste HTML as 
code or as converted to plain text.

Given this mess, quotations should I think be copied into text/plain 
with at least "" quotes if not more language-specific ones. Otherwise 
the fact that they are quotations is lost. In practice, browsers might 
wish to use the CSS quotes property, if it in fact has content, as a 
hint at what language-specific ones should be.

--
Benjamin Hawkes-Lewis

Yahia wrote:
> 
> On Sun, 22 Apr 2007 07:23:14 -0000, Spartanicus <mk98762@gmail.com> wrote:
> 
>>
>> Yahia <cyahia@gmail.com> wrote:
>>
>>> 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 disagree. If the CSS generated content is used appropriately by
>> authors, i.e. for presentational purposes only, then only the content
>> proper without presentation should be selectable in a UA.
> 
> Quotes are not presentational.
> 
>>
>> And there is an inconsistency in Opera's behaviour given that it doesn't
>> allow selection of the numbers of an ordered list when those numbers
>> have been generated by Opera without using author supplied CSS generated
>> content. This is the right behaviour.
> 
> Opera allows copying of the quotes generated around a <q/> element and 
> not the bullets and numbers of the list elements; IMO, even if it's 
> inconsistent, it is an acceptable behavior, compared to what Firefox 
> does. Here are some quick tests I just did:
> 
> Legend
> <q> = <q/>'s default generated quotes.
> list = <ul/> and <ol/>'s default generated bullets and counters.
> css = CSS-generated content.
> 
> /--------------------------------\
> |      |  Opera 9.2 for Windows  |
> |      |-------------------------|
> |      | allows  | plain | style |
> |      | select. | copy  | copy  |
> |--------------------------------|
> | <q>  |   yes   |       |  yes  |
> |--------------------------------|
> | list |   no    |  no   |  no   |
> |--------------------------------|
> | css  |   yes   |  yes  |  yes  |
> \--------------------------------/
> 
> /--------------------------------\
> |      |  Firefox 2 for Windows  |
> |      |-------------------------|
> |      | allows  | plain | style |
> |      | select. | copy  | copy  |
> |--------------------------------|
> | <q>  |   no    |  no   |  no   |
> |--------------------------------|
> | list |   no    |  yes  |  ?    |
> |--------------------------------|
> | css  |   no    |  no   |  no   |
> \--------------------------------/
> 
> FIrefox is bizarre. It's weird to see unselected bullets being copyed, 
> even with different signs:
> I remarked that sometimes Firefox uses
>    # * o +
> characters to symbolize bullets depending on the situation.
> (I couldn't identify clearly when it puts '#' as a bullet, but it did 
> that with a "list-style-type:square;" list.
> For the other characters, they're used for nested list items.)
> 
> PS: can someone run these simple tests on Safari and report the results?
> 
>>
>>> I would like to know if the CSS specifications say something about this.
>>
>> Afaik it doesn't. CSS2.1 has this:
>> "Generated content does not alter the document tree. In particular, it
>> is not fed back to the document language processor (e.g., for
>> reparsing)."
>> but that doesn't relate to selecting and copying generated content, and
>> no such rule is found in the CSS3 draft.
>>
> 
> It should be there, to eliminate inconsistencies between browsers.
> 
>> But IMO the behaviour should be specified as a MUST NOT. A UA must not
>> facilitate abuse of the generated content method.
>>
> 
> I'd have to disagree.
> 
Received on Tuesday, 24 April 2007 07:59:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:50 GMT