Re: When is a first letter not a :first-letter?

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.

There's a line there
   # Punctuation (i.e, characters defined in Unicode in the "open" (Ps),
   # "close" (Pe), "initial" (Pi). "final" (Pf) and "other" (Po)
   # punctuation classes), that precedes or follows the first letter
   # should be included.

The latest Editor's draft also has a note talking about grapheme clusters
and other letter combinations:
   http://dev.w3.org/csswg/selectors3/#first-letter
This was carefully crafted by Richard Ishida and yours truly awhile ago. :)
It is unfortunately not normative... I think it should be, but IIRC
the concern was about not being able to progress to PR from the draft's
current state... Personally I think the WG should bite the bullet and
publish a new CR--one that addresses all the issues that have been
brought up.

   http://csswg.inkedblade.net/spec/css3-selectors

~fantasai

Received on Friday, 27 June 2008 22:22:03 UTC