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

On 03/29/2010 01:49 PM, Boris Zbarsky wrote:
> On 3/29/10 12:04 PM, fantasai wrote:
>> 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 assume you mean "out of flow" here? Has there been an alternate
> proposal on that?

No, I mean abspos. AFAICT, floats just get wrapped in a block and turned
into a table cell. No?

> What I wrote down is what UAs seem to implement, as I recall.

Yes, but it doesn't make sense unless you know the internals of a layout
engine.

>> Can you look it over and tell me if I got the translation right?
>
> No. Most importantly, your split into "three stages" reintroduces one of
> the problems I was trying to solve. Specifically, item 2 in
> <http://lists.w3.org/Archives/Public/www-style/2009May/0213.html>.

Hmm, yeah. the rules in step 2 are backward. Try this?

  |   2. Generate missing child wrappers:
  |       2.1 If a child C of a tabular container 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]
  |       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' 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]

> Reading over this stuff again, it seems that on this testcase:
>
> <div style="white-space: pre">
> <span style="display: table-cell">a</span>
> <span style="display: table-cell">b</span>
> </div>
>
> both my proposal and yours produce two tables (and possibly the same
> with white-space:normal, depending). That doesn't match either Gecko's
> implementation (which pretty much tells you all you need to know about
> the pain of writing a proposal for this even based on an
> implementation!) or Webkit's or Opera's or IE8's.

Ugh. Useful, but yes, good call...

Change
  |   consecutive
  |     Two sibling boxes are consecutive if they are both in flow and have no
  |     intervening in-flow siblings.
to
  |   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 space.

> Minor nit: Your "internal table box" definition needs to include
> table-column-group.

Instead of table-column twice? Yeah. :)

~fantasai

Received on Tuesday, 30 March 2010 06:00:57 UTC