Re: [CSS21][17.5.2.1 Fixed table layout] Questions on fixed table layout algorithm

On Mon, 16 Jan 2012 23:06:42 +0100, Anton Prowse <prowse@moonhenge.net>  
wrote:

> On 21/11/2011 13:43, Øyvind Stenhaug wrote:
>> On Mon, 21 Nov 2011 01:22:31 +0100, Gérard Talbot  
>> <www-style@gtalbot.org> wrote:
>>> 2- What is the meaning of an empty colgroup for CSS formatting  
>>> purposes?
>>> Colgroup can have 0 or more columns. I think an empty colgroup is  
>>> totally
>>> meaningless and worthless for use in the fixed table layout like in the
>>> following code:
>>>
>>> colgroup {width: 100px;}
>>> ...
>>> <colgroup></colgroup>
>>
>> Yes, I don't see the point of the .colgroup <div>s. The only relevant
>> spec quote I see is
>>
>> "A column group box occupies the same grid cells as the columns it
>> contains."
>
> Is there a potential errata issue here?  I don't clearly follow the  
> issue.

Yes, I think there is. I generally find the table chapter difficult to  
interpret, though, and it's not so easy to come up with just one small  
localized change to fix things. (I also didn't look closely enough last  
time, I think; there are actually more differences between the browsers  
than I thought.)

1) In 17.2 it says that the value 'table-column-group' "[s]pecifies that  
an element groups one or more columns". But it doesn't say how to  
determine which column(s) it groups.

Further down (17.5) it says (as I quoted above) "A column group box  
occupies the same grid cells as the columns it contains." Given that  
17.2.1 ("Anonymous table objects") keeps using the term "box", maybe that  
section is relevant. And it looks like that section assumes that there is  
already an initial box structure that more or less mirrors the element  
tree. So maybe the set of table-column elements contained by a given  
table-column-group element determines which columns the corresponding  
column group box contains. (And further up it has already been stated,  
very imprecisely, that the n-th table-column corresponds to n-th column  
box from the left if the table's 'direction' is ltr - from the right if  
rtl.)

This seems to suggest that if a table-column-group doesn't contain any  
table-column elements at all, it doesn't occupy any grid cells at all.  
That's what I thought in the conversation quoted above. But it turns out  
that's not what any of the browsers actually do. An empty  
table-column-group turns out to occupy one column - like an HTML COLGROUP  
with default span attribute. I couldn't see anything in the spec  
indicating this.

2) (tangentially related) Elements with 'display' set to 'table-column' or  
'table-column-group' "are not rendered (exactly as if they had 'display:  
none')" (17.2). But other parts of the spec talk about  
table-column/table-column-group boxes. This seems inconsistent. Does a  
column box exist in the box structure or not? (And is it really  
appropriate to call these things boxes, even at one point linking to "8.1  
Box dimensions" which has a figure including a margin area?)

3) "The following properties apply to column and column-group elements:"  
"'width'" "The 'width' property gives the minimum with for the column." -  
at one point here, both (table-)columns and (table-)column-groups are  
allowed, but a few lines down, only the column case is acknowledged. What  
happens if the property is set on a column-group? (Multiple occurrences;  
only 'border' mentions column groups.)

The "Automatic table layout" section does consider column groups. I don't  
think it specifies what has been implemented, though - it says to  
"increase the minimum widths of the columns it spans, so that together  
they are at least as wide as the column group's 'width'", but what seems  
to be happening is that the table-column-group's width specifies the  
minimum width for each individual column, similar to an HTML COLGROUP's  
width attribute.

The "Fixed table layout" section doesn't mention column groups at all.  
Maybe this is how it should be, though I'm not sure it's expected for it  
to be different from auto layout in this way. Firefox and IE seem to think  
so, WebKit (and sometimes Opera) not.

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA

Received on Friday, 27 January 2012 16:06:40 UTC