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

Final proposal for issue 110!  For the purpose of solving this issue
for CSS2.1, I propose accepting Fantasai's revised algorithm for
table-repair, with a small correction so that it properly handles
floated elements inside a table* element:


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
  |     (that is, neither are absolute or fixed position) and have no
  |     intervening in-flow siblings other than, optionally, an
  |     anonymous inline containing only white spaces. A sequence of
  |     sibling boxes is consecutiveif 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 and is not absolute or fixed
  |           position, 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 and is not absolute or fixed position, 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'
  |           and is not absolute or fixed position, 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]
  |
  | Note: Absolute and fixed position elements do not participate in
  | the above algorithm in any way.  The static position of absolute
  | or fixed position elements who's parent element is a tabular
  | container is undefined in CSS2.1.

Changes from fantasai's original proposal, written on May 7th:

* text is rewrapped to 70ch to avoid it getting ugly-wrapped again.
* definition of 'consecutive' is clarified to specifically exclude
abspox and fixpos, not floats.
* clarification added to all the substeps in step 2 to ensure that
abspos and fixpos elements don't generate wrappers around themselves.
* informative note added at the end, clarifying the intent that abspos
and fixpos elements don't interact with the table-repair algorithm,
and explicitly stating the static position as undefined.

~TJ

Received on Wednesday, 21 July 2010 00:17:17 UTC