Re: [CSS21] Is a replaced element allowed to be a table box?

Le Sam 14 juillet 2012 19:45, Anton Prowse a écrit :
> On 15/05/2012 00:01, Anton Prowse wrote:
>> 17.2 (The CSS table model) says:
>>
>>    # The following 'display' values assign table formatting rules to an
>>    # arbitrary element:
>>    #
>>    # table [...]
>>    # [...]
>>    #
>>    # Replaced elements with these 'display' values are treated as their
>>    # given display types during layout. For example, an image that is
>>    # set to 'display: table-cell' will fill the available cell space,
>>    # and its dimensions might contribute towards the table sizing
>>    # algorithms, as with an ordinary cell.
>>
>> So what's the deal with
>>
>> <img style="display:table">
>>
>> where presumably an anonymous table wrapper box is generated around the
>> image, but no caption box is present.
>>
>> Similarly, how about
>>
>> <div style="display:table">
>>      <img style="display:table-row">
>> </div>
>>
>> for example?
>>
>> Does table fix-up occur?  Does the image display?  If a table formatting
>> context is established in the first example, does it make sense that the
>> image then displays?
>
>  From what I can tell, Gecko takes a replaced element with display:table
> or display:table-row, gives the replaced element the used value
> display:block and generates a wrapper box with used value display:table
> or display:table-row respectively.  Then it goes and does all the table
> fix-up stuff.

By "fix-up stuff", do you mean generate missing child(ren) or parent(s)
(as stated in section 17.2.1 Anonymous table boxes/objects
 http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes ) or do you mean
something else?


> This seems like a pretty useful heuristic.  Can any other implementers
> comment on what they do?
>
>
> Also, I was surprised to discover that none of Gecko, Webkit and Presto
> permits a replaced box to be a table-cell box.


Anton, do you have a particular test in mind for saying this? I ask
because this test

Image as 'display: table-cell'
http://test.csswg.org/suites/css2.1/20110323/html4/table-cell-002.htm

is passed by Chrome 20.0.1132.57 and Opera 12.0.


Gérard

> Instead they appear to
> wrap the replaced box in an anonymous table cell, and change the display
> type of the replaced box.  Trident seems fine with it though.
>
>
> This issue is filed at
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=17779
>
>
> Cheers,
> Anton Prowse
> http://dev.moonhenge.net
>
>


-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Sunday, 15 July 2012 00:54:01 UTC