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

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 UTC