Re: [CSS21] Does 'clear' apply to caption box? (corrected link)

On 08/01/2013 23:42, Daniel Schattenkirchner wrote:
> On 08/01/2013 22:08, Anton Prowse wrote:
>>> It's impossible to create a testcase to test whether clear really
>>> does apply to table-captions.
>>
>> No, the following should work instead:
>>
>> <div style="display:table; width:100%">
>>      <div style="display:table-caption">
>>          <div style="width:20px; height:20px; float:left;"></div>
>>      </div>
>>      <div style="display:table-caption; clear:left;">caption</div>
>> </div>
>
> Sorry, but that won't work either.
>
> CSS 2.1, 9.4.1: http://www.w3.org/TR/CSS2/visuren.html#block-formatting
> [...], block containers (such [...] table-captions) [...] establish new
> block formatting contexts for their contents.
>
> So Gecko is correct in this regard.

No, that's a misreading of that (awkwardly worded) sentence, which 
should actually be read as:

   # [...] block containers (such as [...] table-captions) *that are not 
block boxes*, [...] establish new block formatting contexts for their 
contents.

Table-captions are blocks and so are excluded.  It's confusing that 
they're even mentioned in that paragraph.  At one point in the past I 
think captions /did/ establish BFCs, and so that mention of them 
probably goes back years.  That particular paragraph has been debated a 
lot, and what we've currently got is probably best described as an 
uneasy compromise.  I'm pretty sure I have proposed changes to that 
paragraph for some of the open bugs, in which I've removed the mention 
of the captions.

That said, if there is strong inter-op for captions establishing a BFC 
then it could be considered for errata, but that's a different story. 
Though I do seem to recall WG solution on this a few years ago, as part 
of deciding whether the table wrapper box establishes a BFC.

>> Note that CSS21 Ch.17 is internally inconsistent on the subject of
>> multiple captions, but very strongly points towards allowing multiple
>> captions.
>
> Unfortunate but true. It isn't hard to implement multiple captions and
> CSS would not prevent them from being rendered (that would be very
> strage for CSS). But I have accepted that tables simply are a mess in
> various regards.

Yes indeed.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Wednesday, 9 January 2013 15:36:41 UTC