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

On 08/01/2013 16:48, Daniel Schattenkirchner wrote:
> On 07/01/2013 21:16, "Gérard Talbot" wrote:
>> Le Lun 7 janvier 2013 10:18, Anton Prowse a écrit
>>> Le Ven 14 décembre 2012 21:29, "Gérard Talbot" a écrit :

>>>> I believe this test
>>>> http://test.csswg.org/suites/css2.1/20110323/html4/clear-applies-to-015.htm
>>>>
>>>>
>>>> may be incorrect.

>> which would mean that clear can/could apply to an element with its
>> display property set to 'table-caption'. So, at least the meta text
>> assert isn't completely true.
>
> I'd agree, since table-captions are block-level boxes (to which clear
> applies).

>>> Note that if you had two captions in a CSS-styled table (something
>>> which is invalid in HTML4 tables), you could float both of them
>>> left and set "clear:left" on the second one, to observe that
>>> 'clear' does apply to table captions... although it isn't a very
>>> useful design pattern so I don't imagine authors do it much!
>
> A floated table-caption is a display: block; box and not part of
> anonymous table box generation.

Whoops, you're right of course!

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


> And even though CSS does allow
> consecutive caption boxes, they are not supported by Gecko and WebKit.

Yeah, this seems to be a new thing in Gecko, since I'm sure I've messed 
around with multiple captions in the past.  Note that CSS21 Ch.17 is 
internally inconsistent on the subject of multiple captions, but very 
strongly points towards allowing multiple captions.  Also, in Gecko at 
least, captions invalidly establish a block formatting context.  So 
there are browser bugs here.

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

Received on Tuesday, 8 January 2013 21:08:41 UTC