Re: UA style sheet for <q>-- why required?

Hi Sam,

On Oct 31, 2008, at 9:54 AM, Sam Kuper wrote:

> 2008/10/31 Thomas Broyer <t.broyer@gmail.com>
> As to identify quotation marks [...] it's actually "quite easy"
>
> No, it really isn't easy. There's been plenty of traffic on the list  
> about why not, with examples.
>
> (you'd
> still have to add some heuristics I guess,
>
> This is, I think, an inappropriate suggestion for a deterministic  
> language (HTML) or language set (HTML + CSS, etc).
>
> such as whether a quotation
> mark at the start –just before or at the beginning of the content– of
> Q is an opening/initial mark, or if a neutral or ambiguous one whether
> there is white space preceding it –a quotation mark 'attached' to a
> preceeding word is probably not an opening mark for the quotation–) to
> identify quotation marks around or within a Q element and determine
> whether to generate ones or not.
>
> Doomed to be inaccurate in at least some cases (e.g. ambiguous  
> ones). Therefore, a very bad idea.
>
> In brief, I tend to believe that it'd be possible for UAs to generate
> quotation marks only when not already provided in content.
>
> It would certainly be possible for a parser to check for the  
> presence of certain characters (from a defined list) in the content  
> of the document, and perform some action if none of those characters  
> are present. In the context of <q>, however, I don't think this  
> would be a smart move. It assumes, for example, that the characters  
> in that list are the only characters that represent quotation marks.  
> I, as an author, wish to use some other character(s) as quotation  
> marks, say "QQQ" to open quotations and "qqq" to close them, the  
> assumption would be false.
>
> Given that there's no need to make that sort of assumption, or to  
> "generate quotation marks only when not already provided in content"  
> - as you put it - I don't think HTML 5 should mandate this.

I really think you should more carefully consider the reasons these  
heuristics are proposed. We need to find a way forward for users,  
authors and UAs alike. Moreover the proposed heuristics do not get in  
the way of an author who wants to do reasonable things in authoring.  
For instance, your QQQ And then a quote qqq example would not be  
hindered at all by this proposal. If you inserted those quotations  
within the HTML (against your own proposed practice) and then relied  
on the default stylesheet you would get a rendering something like

"QQQ And then a quote qqq"

which may not be what was intended, but that could be easily fixed by  
adding no-quotes to one of the document's stylesheets.

If you instead added the QQQ and qqq to the stylesheet any quotation  
marks added by the HTML author would remain and would have to be  
editing out (since you're adding non-quotation marks in the :before  
and :after). So none of the heuristics proposed get in the way of the  
use case you outline.

In addition to the heuristics, it might make sense to add mechanisms  
both to HTML and CSS to control this. For example adding a marks  
attribute accepting the values "needed" (default) or "provided" would  
let authors indicate the authoring convention they were using for  
quotations (as I proposed with issue-48[1]). Also, a mechanism could  
be added to CSS to indicate the open-quote and close-quote should be  
added heuristically (removing any matching quotations from the  
boundary of the element the pseudo elements are attached to). Such a  
CSS property might only be used for UA stylesheets since the author  
might already have control over the authoring convention of the HTML  
(but it might also be useful for author and user stylesheets).

The important feature this heuristic adds is a way forward for UAs.  
Most authors probably provide some mechanism to deal with the  
inconsistency between IE<8 and virtually every other browser on this  
issue. However, some authors target only IE<8 and it will be  
cumbersome to deal with IE8 adding HTML4 quotation styling support  
now. The use of UA and stylesheet styling of quotations will become  
most useful in a decade or so when authors are solely targeting  
browsers properly supporting HTML quotations. In the mean time, we  
need a way to ease the burden on authors to continue doing things the  
IE<8 targeting approach. So far, I'm seeing no downsides to this  
heuristic approach and much to recommend it (though I'm open to the  
fact that I'm missing something).

Take care,
Rob

[1]: <http://esw.w3.org/topic/HTML/AddedAttributeQuotationMarks>

Received on Friday, 31 October 2008 15:17:10 UTC