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

Re: [CSS21] 'overflow' on 'table'/'inline-table'

From: Øyvind Stenhaug <oyvinds@opera.com>
Date: Tue, 26 Jul 2011 17:28:30 +0200
To: www-style@w3.org
Message-ID: <op.vy8fxsaebunlto@oyvinds-desktop>
On Sun, 24 Jul 2011 01:24:14 +0200, Anton Prowse <prowse@moonhenge.net>  
wrote:

> On 23/07/2011 17:39, Anton Prowse wrote:
>> On 19/07/2011 08:37, Øyvind Stenhaug wrote:
>>> Presumably as part of the cleanup for issue 120, section 11.1.1 now  
>>> says
>>> that 'overflow' "Applies to: block containers" and that "This property
>>> specifies whether content of a block container element is clipped" [1].
>>> However, multiple tests in the testsuite assume that it applies to
>>> 'table' and 'inline-table' elements, which are not block containers
>>>
>>> Since I could find a resolution indicating that it should apply [6], I
>>> suppose this is a mistake in the spec text.
>>
>> But (inline-)tables *are* block containers. Or rather, more precisely, a
>> (inline-)table generates two boxes: a "table wrapper" block container
>> box and an inner block-level table box (which sits alongside none or
>> more table caption block boxes).

Hm, good point, I forgot about the table wrapper box. I was a little  
thrown off by the box/element mix (the term "block container element"  
doesn't even seem to be defined).

>> The 2010-12-07 WD of CSS21 says that overflow applies to "non-replaced
>> block-level elements, table cells, inline-table, and inline-block
>> elements",[1] which is precisely the list of block container elements in
>> CSS21 and hence subsequent revisions of the spec simply say that
>> (notwithstanding the perennial box vs element issue, in particular the
>> fact that "inline-table elements" here really means inline-level table
>> wrapper boxes).
>
> I beg your pardon, obviously I'm wrong there: that list includes table  
> boxes in addition to the block container elements.  So the new text in  
> the spec didn't accurately replace the old text, and hence there is  
> something that needs reviewing (albeit not what you originally raised, I  
> think).
>
> I'm embarrassed to say that the new wording is probably due to me.[1] It  
> does seem likely that the new wording was what was always intended,  
> though.  Either way, as I mentioned, none of the tests cited so far  
> would appear to test that:
>
>> Of course, if the issue is that browsers apply overflow to the table box
>> itself, then that certainly up for review. But I don't think that's what
>> the tests you cited show, since I imagine that that could only be
>> meaningfully tested if there were at least one table caption box
>> present, which there isn't.

Right. This seems to suggest that Gecko and IE8 apply overflow to the  
table box whereas WebKit applies it to the table wrapper box:

<!DOCTYPE HTML>
<title>overflow on table with caption</title>
<style>
    table {
       background: gray;
       caption-side: bottom;
       overflow: hidden;
    }
    caption {
       background: teal;
       height: 25px;
    }
    td > div {
       position: relative;
       width: 50px;
       height: 25px;
    }
    div > div {
       width: 100px;
       height: 100px;
       background: navy;
       position: absolute;
    }
</style>
<table>
    <caption></caption>
    <tr>
       <td><div><div></div></div></td>
    </tr>
</table>

> [1] http://lists.w3.org/Archives/Public/www-style/2011Jan/0079.html

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA
Received on Tuesday, 26 July 2011 15:28:59 GMT

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