W3C home > Mailing lists > Public > www-style@w3.org > October 2011

[css21] 17.2.1 Anonymous table objects - nested case

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Wed, 19 Oct 2011 05:08:54 +0800
Message-ID: <4E9DEAE6.6010905@csail.mit.edu>
To: WWW Style <www-style@w3.org>
I found an edge case where, I believe, the spec doesn't match
implementations. Consider:

<div style="display: table-row; white-space:pre;"> <span class="display:
table-row;">A</span> </div>

(Notice the beginning and the trailing spaces inside <div>. See also
online version[1])

rule 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.

doesn't apply here because <span> is not a proper descendant of <div>.
IE 9, Gecko nightly and Safari (but not Opera) do display the beginning
and trailing space and don't match the spec. This applies to nested
'table-row-group' as well.

If this is the desired behavior, I propose we remove the concept of
proper table descendant and it's use:

  | 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
either 'table-caption' or internal table
  | boxes, then it is treated as if it had 'display: none'.

I believe cases like not removing beginning and trailing space for
<span> <span style="display: table-cell">A</span> </span> is already
guarded by restrictions on the type of box for C and P ('an inline' is
not a tabular container). I don't think the notion of proper table
descendant is still needed. I might be wrong though.

This is actually closer to Boris' original proposal[2] I think, as there
wasn't concept of proper table descendant in that proposal either. If my
proposal is adopted, I would future propose we change rule 1.4 to be in
parallel with rule 1.3, so that this part is more understandable (IMO):

  | If a child C of a non-tabular-container box P is an anonymous inline
box that contains 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'.

This is a purely editorial suggestion since I don't think rule 1.4 has
any problem. It just significantly overlaps with rule 1.3 and makes it
difficult to understand. I have more editorial suggestions for this
section which I'll cover in my next mail.

[1]
http://lists.w3.org/Archives/Public/www-archive/2011Oct/att-0016/anonymous-table-and-white-space#e4
[2] http://lists.w3.org/Archives/Public/www-style/2009May/0213

Cheers,
Kenny
Received on Tuesday, 18 October 2011 21:09:35 GMT

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