W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [CSS21] Proposal for a replacement for section 17.2.1 (table anonymous objects)

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 07 May 2010 13:27:35 -0700
Message-ID: <4BE477B7.6040902@inkedblade.net>
To: www-style list <www-style@w3.org>
Resending, because the wonky wrapping was really getting on my nerves...

On 03/31/2010 06:02 AM, Boris Zbarsky wrote:
 > > On 3/31/10 2:39 AM, fantasai wrote:
 >> >> | 1.3 If a child C of a tabular container P is an anonymous inline box
 >> >> | that contains only white space, and its immediately preceding
 >> >> | and following siblings, if any, are proper table descendants of P
 >> >> | and are either 'table-caption' or internal table boxes,
 >> >> | then it is treated as if it had 'display: none'.
 >> >> | A box D is a proper table descendant of A if D can be a descendant
 >> >> | of A without causing the generation of any intervening 'table' or
 >> >> | 'inline-table' boxes.
 >> >> | [current rule 5, adjusted to match bz]
 >> >> | 1.4 If a box B is an anonymous inline containing only white space,
and
 >> >> | it has two immediate siblings both of which are internal table boxes,
 >> >> | then it is treated as if it had 'display: none'.
 >> >> [new]
 > >
 > > Still thinking through this, but why is rule 1.3 needed given rule 1.4?
To handle
    <table>
      <td>A</td>
    </table>
which should have only one cell.

 > > And shouldn't table-caption be mentioned in rule 1.4?
Yes.


Replace the list of rules in 17.2.1 with the following:

    | For the purposes of these rules, the following terms are defined:
    |
    |   row group box
    |     A 'table-row-group', 'table-header-group', or 'table-footer-group'
    |   proper table child
    |     A 'table-row' box, row group box, 'table-column' box, 'table-column-group'
    |     box, or 'table-caption-box'.
    |   proper table row parent
    |     A 'table' or 'inline-table' box or row group box
    |   internal table box
    |     A 'table-cell' box, 'table-row' box, row group box, 'table-column' box,
    |     or 'table-column-group' box.
    |   tabular container
    |     A 'table-row' box or proper table row parent
    |   consecutive
    |     Two sibling boxes are consecutive if they are both in flow and have no
    |     intervening in-flow siblings other than, optionally, an anonymous inline
    |     containing only white spaces. A sequence of sibling boxes is consecutive
    |     if each box in the sequence is consecutive to the one before it in the
    |     sequence.
    |
    | The following steps are performed in three stages.
    |
    |   1. Remove irrelevant boxes:
    |       1.1 All child boxes of a 'table-column' parent are treated as if
    |           they had 'display: none'.
    |           [new]
    |       1.2 If a child C of a 'table-column-group' parent is not a
    |           'table-column' box, then it is treated as if it had
    |           'display: none'.
    |           [new]
    |       1.3 If a child C of a tabular container P is an anonymous inline box
    |           that contains only white space, and its immediately preceding
    |           and following siblings, if any, are proper table descendants of P
    |           and are either 'table-caption' or internal table boxes,
    |           then it is treated as if it had 'display: none'.
    |           A box D is a proper table descendant of A if D can be a descendant
    |           of A without causing the generation of any intervening 'table' or
    |           'inline-table' boxes.
    |           [current rule 5, adjusted to match bz]
    |       1.4 If a box B is an anonymous inline containing only white space, and
    |           is between two immediate siblings each of which is either an internal
    |           table box or a 'table-caption' box then B is treated as if it had
    |           'display: none'.
    |           [new]
    |
    |   2. Generate missing child wrappers:
    |       2.1 If a child C of a 'table' or 'inline-table' box is not a proper
    |           table child, then generate an anonymous 'table-row' box around C
    |           and all consecutive siblings of C that are not proper table children.
    |           [current rule 6]
    |       2.2 If a child C of a row group box is not a 'table-row' box, then
    |           generate an anonymous 'table-row' box around C and all consecutive
    |           siblings of C that are not 'table-row' boxes.
    |           [current rule 7]
    |       2.3 If a child C of a 'table-row' box is not a 'table-cell',
    |           then generate an anonymous 'table-cell' box around C and all
    |           consecutive siblings of C that are not 'table-cell' boxes.
    |           [current rule 8]
    |
    |   3. Generate missing parents:
    |        3.1 For each 'table-cell' box C in a sequence of consecutive internal
    |            table and 'table-caption' siblings, if C's parent is not a
    |            'table-row' then generate an anonymous 'table-row' box around C
    |            and all consecutive siblings of C that are 'table-cell' boxes.
    |            [current rule 1]
    |        3.2 For each proper table child C in a sequence of consecutive proper
    |            table children, if C is misparented then generate an anonymous
    |            'table' or 'inline-table' box T around C and all consecutive
    |            siblings of C that are proper table children. (If C's parent is
    |            an 'inline' box, then T must be an 'inline-table' box; otherwise
    |            it must be a 'table' box.)
    |              * A 'table-row' is misparented if its parent is neither
    |                a row group box or a 'table' or 'inline-table' box.
    |              * A 'table-column' box is misparented if its parent is neither
    |                a 'table-column-group' box nor a 'table' or 'inline-table' box.
    |              * A row group box, 'table-column-group' box, or 'table-caption'
    |                box is misparented if its parent is neither a 'table' box nor
    |                an 'inline-table' box.
    |            [current rules 2, 3, 4]

~fantasai
Received on Friday, 7 May 2010 20:28:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT