Brad Kemper | 1 Jan 2009 01:21
Picon

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


On Dec 31, 2008, at 12:14 PM, L. David Baron wrote:

>
> On Tuesday 2008-12-30 14:36 -0800, Brad Kemper wrote:
>> 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.)

Well, I suppose it is not. It just seemed like there should be a way  
to specify a fallback for when the value didn't apply. But since text- 
align is inherited, it probably wouldn't be that big of a deal most of  
the time to set the fallback value on an ancestor object.

>> 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
(Continue reading)

L. David Baron | 1 Jan 2009 01:41
Gravatar

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


On Wednesday 2008-12-31 16:21 -0800, Brad Kemper wrote:
> On Dec 31, 2008, at 12:14 PM, L. David Baron wrote:
>> On Tuesday 2008-12-30 14:36 -0800, Brad Kemper wrote:
>>> 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

> Well, I suppose it is not. It just seemed like there should be a way to 
> specify a fallback for when the value didn't apply. But since text-align 
> is inherited, it probably wouldn't be that big of a deal most of the time 
> to set the fallback value on an ancestor object.

That doesn't help.  The string value is still the only thing that
gets through in the "doesn't apply" case.

> OK, thanks; I wasn't aware of that. Given that, could this say "String  
> values for text-alignment do not apply to anything other than table  
> cells" (removing the part about it being treated as 'start')? That way, 
> the non-table-cell would still be free to inherit its text-alignment from 
> its nearest ancestor with a valid value, instead of being forced to be 
> "left". Isn't that the way things normally work if I give some invalid 
> value, such as <div style="text-align:not-valid;"> ? It seems like this 
> would be simpler than having a special built-in 'start' value.

This doesn't work.  'text-align: not-valid' can be ignored long
before we know whether something is a table cell.  But a value that
(Continue reading)

Brad Kemper | 1 Jan 2009 01:57
Picon

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


On Dec 31, 2008, at 4:41 PM, L. David Baron wrote:

>> OK, thanks; I wasn't aware of that. Given that, could this say  
>> "String
>> values for text-alignment do not apply to anything other than table
>> cells" (removing the part about it being treated as 'start')? That  
>> way,
>> the non-table-cell would still be free to inherit its text- 
>> alignment from
>> its nearest ancestor with a valid value, instead of being forced to  
>> be
>> "left". Isn't that the way things normally work if I give some  
>> invalid
>> value, such as <div style="text-align:not-valid;"> ? It seems like  
>> this
>> would be simpler than having a special built-in 'start' value.
>
> This doesn't work.  'text-align: not-valid' can be ignored long
> before we know whether something is a table cell.  But a value that
> works some of the time needs to be cascaded through.
>
> If fallback for this case is important, it should be in the value of
> the property (e.g., 'text-align: "." right').  That said, I'm not
> convince that it's important.

Wow. OK. I didn't realize it would be that hard to get a reasonable  
fallback value. In the case of decimal numbers, I would want the  
columns to be aligned on the decimal. That has got to be the most  
common use case, no? Especially if you don't know how many decimal  
(Continue reading)

L. David Baron | 1 Jan 2009 02:05
Gravatar

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


On Wednesday 2008-12-31 16:57 -0800, Brad Kemper wrote:
> Wow. OK. I didn't realize it would be that hard to get a reasonable  
> fallback value. In the case of decimal numbers, I would want the columns 

This was the discussion about fallback if text-align: <string> was
used on something not a table cell; not the case about fallback if
the cell doesn't have appropriate text.

> to be aligned on the decimal. That has got to be the most common use 
> case, no? Especially if you don't know how many decimal places will be in 
> each number. But if the same column happened to contain integers instead 
> of decimals, then I would want them to line up on the right. Always 
> (assuming they are values to be compared with one another).

I think for the case where the cell doesn't have the appropriate
text, assuming that the alignment text is right after the text of
the cell probably makes sense, given that the primary use case is
decimals.  (This would imply that when none of the cells have the
text, it's equivalent to text-align: end.)

-David

--

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Brad Kemper | 1 Jan 2009 05:06
Picon

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

I apologize if you've seen this more than once. I've been having some e-mail problems that caused it to be sent from the wrong server.
--------------------------------

On Dec 31, 2008, at 4:41 PM, L. David Baron wrote:
Although I do think that it should perhaps say something like that for  
what happens if the character is not in the text of the table cell (I  
haven't tested that, but in the most common use case of decimal  
alignment, I image end-edge would be preferred, if there is not  
decimal/period/full-stop character).

Agreed that it needs to say something.  (I vaguely remember brining
that issue up many years ago.)  For that case, the start-edge is
probably preferred, so you get:
  $4.99
 $50

I disagree about start-edge. Consider a column with decimal alignment styling, that may contain either decimals or integers, but usually not both in the same table. I that case, I would want the following (numbers with no decimal) to be right aligned:

      599
6,000,000
   20,272
        5

Useful especially when the numbers get tallied into some sort of total. This would most closely resemble the desired effect when the decimal is present:

      599.45
6,000,000.333334
   20,272.0
        5.123

(I used Courier New, a monospaced font, on the numbers above to try to simulate the effect of having the places of the numbers line up)

If the column contains a mix of numbers with and without decimals in the same table, then I think it is unlikely that there is any way to get them to line up nicely anyway, unless there was a new value of text-align:

text-align:decimal;
/* aligns on the localized version of the decimal character, similar to <string>, but with an invisible decimal character to the right of the text if the text has no decimal character of its own */


I'd also note that how to align the character has to be specified
anyway for the case of different cells that align the same character
in different fonts (where that character has different widths).
(The common realistic case here is probably changes in font-weight.)

Good point. I also don't see anything there about what to do if the alignment character appears more than once in the text. 

Brad Kemper | 1 Jan 2009 05:07
Picon

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


I apologize if you've seen this more than once. I've been having some  
e-mail problems that caused it to be sent from the wrong server.
--------------------------------

On Dec 31, 2008, at 5:05 PM, L. David Baron wrote:

> On Wednesday 2008-12-31 16:57 -0800, Brad Kemper wrote:
>> Wow. OK. I didn't realize it would be that hard to get a reasonable
>> fallback value. In the case of decimal numbers, I would want the  
>> columns
>
> This was the discussion about fallback if text-align: <string> was
> used on something not a table cell; not the case about fallback if
> the cell doesn't have appropriate text.

Yes, you are right. Sorry. Here is the use case:

.numbers { font-family:courier; font-size:14px; color: red; text- 
align:"."; }

Now, imagine that besides applying this class to a table cell, I also  
apply it to block elements as well, in order to pick up the other  
properties:

<div class="numbers">
$ 123.50<BR>
$ 0.75<BR>
$300.00
</div>

Ideally, those would be right aligned. And you are probably right  
about this part not being that important, if it is a big deal, since  
there are other ways to get it to have another alignment (such a  
DIV.numbers rule). My druthers would be to allow author flexibility or  
to have "right" be the fallback value in this situation. But of  
course, I don't have to do the work to implement my druthers in the  
browser program.

Brad Kemper | 1 Jan 2009 05:07
Picon

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


I apologize if you've seen this more than once. I've been having some  
e-mail problems that caused it to be sent from the wrong server.
--------------------------------

On Dec 31, 2008, at 4:41 PM, L. David Baron wrote:

>>>>
>>>> 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?
>>
>> Well, both Tab and I assumed that was the intent anyway, and was just
>> not worded quite right.
>
> I'm not convinced it was.  I could imagine that case not being
> considered; the HTML4 spec says a good bit about char alignment but
> doesn't mention it.
>
>> Here's a contrived use case of the kind of thing I was imagining:
>>
>> TD.price { text-align:"." }
>> TD.rating { text-align:"0" }
>
> Seems like TD.rating really just should be text-align: left.

Sorry. I meant for my example to use en dashes (&ndash), not en  
spaces. Thus, the zero would not always be on the left, but would be  
aligned with the other zeros, sometimes with an arbitrary number of  
dashes to the left, and sometimes with an arbitrary number of pluses  
to the right. Like this (corrected):

TD.price { text-align:"." }
TD.rating { text-align:"0" }

<table>
<tr>
    <td rowspan="2">Thing #1</td>
    <td class="price">$ 45.00</td>
</>
<tr>
    <tdclass="rating">0++</td>
</tr>
<tr>
    <td rowspan="2">Thing #2</td>
    <td class="price">$ 5,000.00</td>
</>
<tr>
    <tdclass="rating">&ndash&ndash&ndash0</td>
</tr>
<tr>
    <td rowspan="2">Thing #3</td>
    <td class="price">$ 5.00</td>
</>
<tr>
    <tdclass="rating">0++++</td>
</tr>
</table>

L. David Baron | 1 Jan 2009 05:35
Gravatar

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


On Wednesday 2008-12-31 17:27 -0800, Brad Kemper wrote:
> On Dec 31, 2008, at 4:41 PM, L. David Baron wrote:
>>> Although I do think that it should perhaps say something like that for
>>> what happens if the character is not in the text of the table cell (I
>>> haven't tested that, but in the most common use case of decimal
>>> alignment, I image end-edge would be preferred, if there is not
>>> decimal/period/full-stop character).
>>
>> Agreed that it needs to say something.  (I vaguely remember brining
>> that issue up many years ago.)  For that case, the start-edge is
>> probably preferred, so you get:
>>   $4.99
>>  $50
>
> I disagree. Consider a column with decimal alignment styling, that may  
> contain either decimals or integers, but usually not both in the same  
> table. I that case, I would want the following (numbers with no decimal) 
> to be right aligned:
>
>       599
> 6,000,000
>    20,272
>         5

Agreed.  I meant to say end-edge but for some reason I wrote
start-edge.

-David

--

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

François REMY | 1 Jan 2009 13:00
Picon
Favicon
Gravatar

Re: vendor keyword history


> Garrett Smith:
> http://www.w3.org/TR/CSS21/syndata.html#vendor-keyword-history
>
> Any others?

Why -webkit- and -khtml- don't appear in the list ?

Fremy 

Benjamin Hawkes-Lewis | 1 Jan 2009 13:48

Re: vendor keyword history


On 1/1/09 12:00, François REMY wrote:
>
>> Garrett Smith:
>> http://www.w3.org/TR/CSS21/syndata.html#vendor-keyword-history
>>
>> Any others?
>
> Why -webkit- and -khtml- don't appear in the list ?

Also -prince- : http://www.princexml.com/doc/6.0/properties/

--
Benjamin Hawkes-Lewis


Gmane