W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: When is a first letter not a :first-letter? [css3-selectors]

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 04 Aug 2010 14:46:11 -0700
Message-ID: <4C59DFA3.9040604@inkedblade.net>
To: Simon Montagu <smontagu@smontagu.org>
CC: www-style@w3.org
On 06/27/2008 08:55 AM, Simon Montagu wrote:
>
> The section on "The :first-letter pseudo-element" at
> http://www.w3.org/TR/CSS21/selector.html#x53 and parallel sections in
> other CSS versions nowhere specifies whether there is any restriction on
> which characters can be selected by :first-letter, or in other words,
> what is the definition of "letter" for the purposes of this section.
>
> It does specify that the ':first-letter' also applies if the first
> letter is in fact a digit, e.g., the "6" in "67 million dollars is a lot
> of money.", and to me this seems to imply that it does not apply if the
> first character is neither a digit nor a letter, e.g. the "$" in
> "$67,000,000 is a lot of money". It would be clearer if this was defined
> explicitly in terms of Unicode character classes, as with punctuation in
> the previous paragraph.
>
> In practice, user agents seem to apply :first-letter to either the first
> character (plus leading punctuation) regardless of character class, or
> in the worst case to the first UTF-16 code unit.

I think we probably want :first-letter to apply to the grapheme cluster
that includes the first character of either a Letter, Number, or Symbol
class. (The spec explicitly includes "letters" and "digits", and says to
slurp punctuation, but doesn't say what to do with "symbols".)

It's not clear from the spec whether punctuation of classes Pd and Pc
are slurpable: the spec says "punctuation" generally, but then excludes
them from the list of punctuation character classes when it tries to
list those classes.

~fantasai
Received on Wednesday, 4 August 2010 21:46:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:30 GMT