W3C home > Mailing lists > Public > www-style@w3.org > July 2012

Re: [css3-text] clarifying text-transform:capitalize

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 18 Jul 2012 10:57:58 -0400
Message-ID: <5006CEF6.4030108@inkedblade.net>
To: Jonathan Kew <jonathan@jfkew.plus.com>
CC: www-style Style <www-style@w3.org>
On 03/01/2012 09:14 AM, Jonathan Kew wrote:
> I realize this has come up before (a thread in Feb 2011, for example), but I'd like to see if we can get a little more clarity - and perhaps eventually interoperability - regarding the ‘capitalize’ transform. (Yes, I know it'll never be "perfect"!)
>
> The current text at http://www.w3.org/TR/css3-text/#text-transform says
>
>    ‘capitalize’
>      Puts the first _letter_ of each word in titlecase; other characters are unaffected.
>
> where _letter_ is defined as
>
>    A letter for the purpose of this specification is a character belonging to one of the Letter or Number general categories in Unicode. [UAX44]
>
> and we're warned that: "The definition of "word" used for ‘capitalize’ is UA-dependent; [UAX29] is suggested (but not required) for determining such word boundaries."
>
> I put a small test-case at http://people.mozilla.org/~jkew/capitalize.html, which applies the ‘capitalize’ transform to two lines of text:
> ...
> What I'd like to confirm - hence this message - is:
>
> (a) that we're happy with the CSS3 Text definition here, as far as it goes, in particular recognizing that it means certain word-initial punctuation characters will be treated differently by ‘first-letter’ and ‘capitalize’; and

I think this is all right. Where a letter isn't included in ::first-letter,
it's because the punctuation that's first has enough standing to be considered
the first "thing". But here we want the first letter of each "thing", so even
if the punctuation at the beginning is a "thing", the word that comes after it
is still a "thing". If that makes sense...

> (b) that the circled letters, being categorized as Symbols rather than Letters, should _not_ be affected by ‘capitalize’ (i.e. the expected result is B2b).

Or by uppercase/lowercase. Yeah, I'll add that to the spec; only letters
should be affected by casing operations.

~fantasai
Received on Wednesday, 18 July 2012 14:58:34 GMT

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