- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Fri, 17 Nov 2006 16:15:00 -0600
- To: www-style@w3.org
Summary: should anonymous table children of inlines generate inline-table boxes instead of table boxes? Details: Consider the following markup/style: <html> <style> .test { display: table-cell } </style> <body> <span> Test <span class="test">Test</span> Test </span> <body> </html> Per the current CSS2.1 specification the <span class="test"> should be wrapped in anonymous table-row, table-row-group, and table boxes. The resulting rendering should then have each of the three words in the testcase on a separate line, since "display: table" boxes are block-level. This is in fact what khtml 3.5 and Safari 2.0.4 implement. Sadly, this is not what Gecko implemented back in the distant past; in Gecko this situation creates a box that acts more like "display: inline-table" than "display: table". In particular, the three words end up on one line. I've done some testing, and Opera 9 seems to behave like Gecko. IE, of course, doesn't support "display: table-cell", so the span is just an inline in IE. The problem is that sites actually use this to get a poor-man's "display: inline-block", as far as I can tell. This works in Gecko, Opera, and IE (esp. since IE allows setting width on "display: inline" boxes); presumably the site operators are not exactly testing on Linux or Mac, so don't realize it doesn't work in Safari or khtml. We've had Gecko bug reports filed pretty quickly when this behavior gets broken in trunk builds [1,2]. As a result, we would find it difficult to switch to the spec-compliant behavior, especially in quirks mode. See discussion in the bug database starting at <https://bugzilla.mozilla.org/show_bug.cgi?id=297537#c8>. Quite apart from the practical considerations, it would generally make as much sense to make the anonymous table in this case an inline-table as it does to make it a table. Possibly more sense. Thoughts? -Boris [1] https://bugzilla.mozilla.org/show_bug.cgi?id=360065 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=297537
Received on Friday, 17 November 2006 22:15:30 UTC