W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [css3-text] @text-transform order

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sun, 18 Dec 2011 15:26:25 -0800
Message-Id: <CC14E531-0F86-4A3D-B3A0-0B241E2639E0@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
To: Koji Ishii <kojiishi@gluesoft.co.jp>

On Dec 18, 2011, at 10:57 AM, Koji Ishii <kojiishi@gluesoft.co.jp> wrote:

> How would we define the order to apply multiple @text-transform rules?
> @text-transform a { "abc" to "cde"; }
> @text-transform b { "abc" to "fgh"; }
> <span style="text-transform: a b;">a</style>
> Would it be "h" or "f"? I guess UA applies rules from left to right and therefore "h"?

First off, I think that the 'text-transform' property should accept only one value, and combinations should happen in the @rule. Like so: 

@text-transform a { "abc" to "cde";
@text-transform ab { a, "abc" to "fgh"; }
<span style="text-transform: ab;">a</style>

I like that better than trying to remember which text-transform property values are allowed to be combined and which are not. 

In any event, I'd say "f" is the final result. The transformation of "a" into  "f" overrides the transformation of "a" into  "c". There is no cumulative effect on individual glyphs; when two transformations target the same glyph (or exact same combination of glyphs), then the last one wins. Thus the effect of '@text-transform numberize-lc { capitalize, "a-z" to "0-9" }' would be to turn all lowercase letters into numbers (with a lot of 9's), not just all but the first letter of each word. For that, you would do '@text-transform numberize-lc {"a-z" to "0-9", capitalize }'. 

> Is it technically feasible to use the same rule for built-in values?
> <span style="text-transform: a b uppercase;">a</style>
> => becomes "H"

No, with my way of thinking, the "a" to "A" part of 'uppercase' would win. 

> <span style="text-transform: uppercase a b;">a</style>
> => becomes "A"

That is the opposite of what I'd expect. 

> I also think prohibiting combinations could be an option for Level 3.
> Thoughts?

I still also prefer the combining to happen inside the @rule, and not allow multiple values in one declaration of the 'text-transform' property. 
Received on Sunday, 18 December 2011 23:27:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:11 UTC