Re: Percentage Height of a Replaced Element in a Table Cell

Le Ven 10 août 2012 13:05, Robert Hogan a écrit :
> On Thu, Aug 9, 2012 at 11:15 PM, "Gérard Talbot"
> <css21testsuite@gtalbot.org
>> wrote:
>
>>
>> > 10.
>>
>>  http://roberthogan.net/css/max-height-percentage-replaced-006.htm
>>
>>
>> html, body, table, tbody, td {
>>                 width: 100%;
>>                 height: 100%;
>>                 padding: 0;
>>                 margin: 0;
>>                 vertical-align: top;
>>             }
>>
>>
>> table-row-groups can not be set a height; that's given by the spec or
>>
>> http://wiki.csswg.org/spec/css2.1#issue-133
>>
>> and table-row-groups can not be set to a width
>>
>> 10.2 Content width: the 'width' property
>>
>> 'width'
>>     Applies to:         all elements but non-replaced inline elements,
>> table
>> rows, and row groups
>>
>> http://www.w3.org/TR/CSS21/visudet.html#the-width-property
>>
>> So, we have again a situation where any size is possible, permissible.
>>
>
>
> Hi Gérard,
>
> Is tbody a red-herring in this test case then?

"red-herring" : a difficult word for me (... my natural/mother tongue is
French).

> Would the behaviour be
> any
> better defined if I said:
>
> html, body, table, td {
>                 width: 100%;
>                 height: 100%;
>                 padding: 0;
>                 margin: 0;
>                 vertical-align: top;
>             }

Yes, it would be better but ...

		"
		CSS 2.1 does not define how the height of table cells and
		table rows is calculated when their height is specified
		using percentage values.
		"
		17.5.3 Table height algorithms
		http://www.w3.org/TR/CSS21/tables.html#height-layout

so we still can not predict in a reliable way the height of that black
area in the test.

If td {height: 100%;} can not be defined, can not be predicted, then img
{max-height: 100%;} will not be either.


> Or is the initial containing block rule not coming into play at all
> here?


Have a look at your test slightly modified in 3 versions:

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-height-percentage-replaced-006a-GT.htm

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-height-percentage-replaced-006b-GT.htm

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-height-percentage-replaced-006c-GT.htm

Gérard
-- 
Contributions to the CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

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

CSS 2.1 test suite harness:
http://test.csswg.org/harness/

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

Received on Friday, 10 August 2012 19:59:50 UTC