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

Re: [CSS3] CSS Text Level 3, 6.1: text-align: string

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 31 Dec 2008 15:14:33 -0500
To: www-style@w3.org
Message-ID: <20081231201433.GB8229@pickering.dbaron.org>

On Tuesday 2008-12-30 14:36 -0800, Brad Kemper wrote:
> In CSS3 Working Draft for CSS Text, in the part about text alignment[1], 
> there is a description of text-align:<string>, quoted below:

For what it's worth, text-align: <string> is also in CSS 2.0 (I
think because its equivalent is also in HTML4).

> 2. Also, I don't know if it has been brought up before or not, but when 
> text-align:<string> is applied to a non-table-cell, shouldn't it just be 
> ignored, instead of being treated as "start"? That seems like it would 

No existing CSS properties work like this, and it would add a good
bit of implementation complexity to do this.  (Although I think it's
one of the same issues that makes CSS variables difficult.)

I don't see what actual use cases doing this would help, though.
(There are lots of cases where specifying unwanted properties causes
unwanted behavior; I don't see why this one should be different.)

> 3. Shouldn't "When applied to a table cell" be replaced by "When applied 
> to a table cell, table column, or table column group"? Is is it 

I don't think text-align has any effects on columns or column
groups.

> apply text-align: '.' to a TABLE element, should it be inherited by the 
> TDs of that table? If it is "treated as 'start'", then the TDs would 
> inherit it as 'start' also, wouldn't they?

It should be inherited when it doesn't apply.  We state generally
that the "Applies To" line in general doesn't affect what is
inherited unless specified otherwise:
  # The computed value exists even when the property doesn't apply,
  # as defined by the 'Applies To' line. However, some properties
  # may define the computed value of a property for an element to
  # depend on whether the property applies to that element. 
  --http://www.w3.org/TR/2007/CR-CSS21-20070719/cascade.html#computed-value

> 4. Shouldn't "that also have a character value for 'text-align' will  
> align" be replaced by "that also have the same <string> value for  
> 'text-align' will align"? After all, some cells in the column could  
> align to some other character, couldn't they (if they had a different  
> class, for instance)?

Are there use cases that require this?  It would make implementation
a bit more complicated.  Could we instead say that when aligning
cells with different text-align: <string> values, implementations
should simply align either the start-edge or the end-edge of all the
alignment characters?


One of the trickiest issues with implementing text-align: <string>
is actually its effects on intrinsic width computation.  It
effectively requires carrying around either two or four additional
intrinsic preferred widths for table columns:  the intrinsic
preferred width of string-aligned cells before the alignment point,
and the same for after the alignment point, and potentially the same
for intrinsic minimum widths.  Then we'd need to figure out exactly
how those additional numbers should affect the table's intrinsic
preferred width, the table's intrinsic minimum width (if at all),
and the column-balancing algorithm.

We also probably need to specify how text-align: <string> interacts
with column-spanning cells.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Wednesday, 31 December 2008 22:18:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:18 GMT