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

On 05/29/2009 11:59 PM, Boris Zbarsky wrote:
> I've recently been working on Gecko's support for section 17.2.1 of
> CSS2.1 (table anonymous objects), and I've run into a number of cases
> where behavior is underdefined, or not defined the way browsers actually
> implement it. I've posted about some of these issues in the past.
>
> I've decided to write up a proposal based on what I've ended up
> implementing in Gecko.
> ...

Ok, I've tried to render your algorithm into something I can understand
and that we can put directly in the spec. I've left out handling of abspos
elements, because I"m not sure that we want to do what you propose. I'll
add it in once I have a better idea of what direction the WG wants to go
in. Can you look it over and tell me if I got the translation right?

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' 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. 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 an descendant
  |           of A without causing the generation of any intervening 'table' or
  |           'inline-table' boxes.
  |           [current rule 5, attempted to match bz, unsure of modifications]
  |
  |   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 Monday, 29 March 2010 20:43:36 UTC