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

Le Lun 21 novembre 2011 4:43, Øyvind Stenhaug a écrit :
> On Mon, 21 Nov 2011 01:22:31 +0100, Gérard Talbot <www-style@gtalbot.org>
> wrote:
>
>> Hello,
>>
>> [nightly-unstable]
>> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/table-layout-applies-to-006.htm
>>
>> [RC6]
>> http://test.csswg.org/suites/css2.1/20110323/html4/table-layout-applies-to-006.htm
>>
>> "
>> In the fixed table layout algorithm, the width of each column is
>> determined as follows:
>>
>>     A column element with a value other than 'auto' for the 'width'
>> property sets the width for that column.
>>     Otherwise, a cell in the first row with a value other than 'auto'
>> for
>> the 'width' property determines the width for that column. If the cell
>> spans more than one column, the width is divided over the columns.
>> (...)
>> "
>> section 17.5.2.1 Fixed table layout
>> http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout
>>
>> The algorithm given in section 17.5.2.1
>> http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout
>> requires as input the set non-auto width of the table (and table borders
>> in border-collapse: collapse mode or cell spacing in border-collapse:
>> separate; we'll just assume we have such info) and then one of the
>> following 2 data:
>> - one set non-auto width of a column or
>> - one set non-auto width of a cell in first row
>>
>> Now, in the table-layout-applies-to-006 testcase, we do not have one of
>> those 2 data. Because of that, I think the testcase is incorrect. Am I
>> wrong here?
>
> I believe so, yes. The next sentence in the section you quoted:
>
> "Any remaining columns equally divide the remaining horizontal table space
> (minus borders or cell spacing)."


The way bullets 1. 2. 3. are arranged mislead me to think that bullet 3
was executed only if bullet 1 or bullet 2 has been successful at least
once.

The "Any remaining columns" lead me to think that at least 1 column width
had to be figured out, had to be established by one of the 2 bulletted
info before.


> The parenthetical seems like sloppy wording

What the parenthetical would be trying to say is:

The width of a CSS table in the border-collapse: separate model is the
distance from the left inner padding edge to the right inner padding edge
(including the border spacing but excluding table padding and table
borders).

The width of an HTML <table> element in the border-collapse: separate
model is the distance from the left border edge to the right border edge.

The width of a HTML <table> in the border-collapse: collapse model is the
distance from middle of the first cell's collapsed left border to the
middle of the last cell's collapsed right border plus half of table
borders.
The width of table borders is half of the first cell's collapsed left
border, and the right border width of the table is half of the last cell's
collapsed right border.

Gérard

, but luckily there are no
> borders or cell spacings here so each column gets 10em/2.
>
>> 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."
>
>> 3- Even if I have
>>
>> colgroup {width: 400px;}
>> (...)
>> <colgroup>
>>   <col>
>>   <col>
>> </colgroup>
>>
>> in a simple 2 column (2 cells per row) table with 'table-layout: fixed',
>> no one can establish how wide are respectively supposed to be first
>> column
>> and second column. Am I wrong?
>
> It seems reasonably clear from the spec that the colgroup width should be
> ignored, and your test results indicate that the majority of the browsers
> tested conform to this.
>
>> 3 testpages on all this:
>>
>> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006a.html
>>
>> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006b.html
>>
>> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006c.html
>
> --
> Øyvind Stenhaug
> Core Norway, Opera Software ASA
>


-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Monday, 21 November 2011 16:59:59 UTC