W3C home > Mailing lists > Public > www-style@w3.org > September 2012

[CSS2.1] abs. pos. inline-block replaced element's height set to a percentage

From: Gérard Talbot <www-style@gtalbot.org>
Date: Mon, 3 Sep 2012 20:54:19 -0400
Message-ID: <912376170bf0c5b7bc1b989f77f89c8d.squirrel@ed-sh-cp3.entirelydigital.com>
To: "Public W3C www-style mailing list" <www-style@w3.org>



Is this test correct?

An iframe, which is an inline-block replaced element, does not have an
intrinsic height, does not have an intrinsic width and does not have an
intrinsic ratio. So, how could it have, under any circumstances, an
intrinsic height, like the assert text is suggesting?

In that test, the div#containing-block's height is 'auto'. And it is
resolvable: it is 0 in that test. Because
the height of the containing block of an absolutely
positioned element is independent of the size of the element itself,
and thus a percentage height on such an element *_can always be
resolved_*. However, it may be that the height is not known until
elements that come later in the document have been processed.

Is my reasoning correct?

And what should be the consequences of writing in the spec that a
percentage height on the containing block of an absolutely
positioned element *_can always be resolved_* ?

Nowhere do I see in the spec that a percentage of the height of a
containing block (whose height is not resolvable) must be 0.

What am I missing here?




In those 2 tests, the height of div#containing-block is 'auto'. I have
intentionally added a 400px tall image in it. And then I test the
rendering of <iframe height="50%"> (which has red borders). Now, if the
height of div#containing-block was *not* resolvable, we would see red
borders but we don't. The height of the div#containing-block is resolved
to be 400px. And so <iframe height="50%"> is rendered in a predictable

CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Tuesday, 4 September 2012 00:54:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:03 UTC