W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [css3-text] should 'tab-size' be in spaces or '0' characters?

From: Simon Sapin <simon.sapin@exyr.org>
Date: Mon, 25 Mar 2013 13:20:09 +0100
Message-ID: <515040F9.20708@exyr.org>
To: www-style@w3.org
Le 25/03/2013 05:58, L. David Baron a écrit :
> http://dev.w3.org/csswg/css3-text/#tab-size  defines a 'tab-size'
> property taking an integer to be multiplied by the advance width of
> the space (U+0020) character.
>
> However,http://dev.w3.org/csswg/css3-values/#font-relative-lengths
> defines the 'ch' unit as using the advance width of the '0' (U+0030)
> character, which I believe was the result of implementation
> experience that '0' produced good results for sizing in proportional
> fonts, and made no difference in monospace fonts.  (I think that
> implementation experience related specifically to sizing of text
> inputs.)
>
> Should 'tab-size' instead use the '0' width rather than the ' '
> width?  I think I would prefer such a change.

I like that this simplifies implementation (<integer> values are either 
invalid or converted to <length> with the ch unit) but I wonder about 
the impact on existing content.

In my browser/system’s default font (I’m not sure which it is), 1ch is 
about twice the width of a space. Assuming the initial value remains 
8(ch), this change makes a big rendering difference for preserved tabs 
in non-monospace fonts. Do we have data on how (un)common these are?

Test case:

data:text/html,<a>0000</a><p><a>    </a><style>a{border:1px 
solid;white-space:pre

-- 
Simon Sapin
Received on Monday, 25 March 2013 12:20:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT