W3C home > Mailing lists > Public > public-css-testsuite@w3.org > August 2012

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

From: Robert Hogan <lists@roberthogan.net>
Date: Tue, 7 Aug 2012 22:57:51 +0100
Message-ID: <CAD1xn+MHvPrmu2Ba_nC4Eveb9vKbsB5JFGxOJGovgAk=2KodPA@mail.gmail.com>
To: public-css-testsuite@w3.org
My snippets were incorrect. :(

So let me try that again:

Browsers disagree on how to render this snippet:

        <table style="width:20px;height:20px">

<td style="width:100%;height:100%"><img style="height:100%"

WebKit, FF: the image is rendered as 50x50
IE, Opera: the image is rendered as 20x20

I believe IE and Opera are correct here: "The percentage is calculated with
respect to the height of the generated box's containing block." Going up
the chain this is 20px.

This is distinct from the following case, where rendering 50x50 would be
the right thing to do:

                <td><img style="height:100%" src="50x50.png"></td>

"If the height of the containing block is not specified explicitly (i.e.,
it depends on content height), and this element is not absolutely
positioned, the value computes to 'auto'."

Am I right in thinking this?

Received on Tuesday, 7 August 2012 21:58:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:13:24 UTC