Previous Message
Next Message

IE7B2 calculates the containing box of absolutely positioned elements wrong?

Sent by Tom on 29 March 2006 07:07


Check out: http://tomabuct.googlepages.com/CSS20.htm

The spec states under 10.3.7 - Absolutely positioned, non-replaced elements:

>'left' + 'margin-left' + 'border-left-width' + 'padding-left' +
'width' + 'padding-right' + 'border-right-width' + 'margin-right' +
'right' = width of containing block

and it states under 10.1 Definition of "containing block":

>If the element has 'position: absolute', the containing block is
established by the nearest ancestor >with a 'position' of 'absolute',
'relative' or 'fixed', in the following way:
>
>.....
>
>Otherwise, the containing block is formed by the padding edge of the ancestor.
>If there is no such ancestor, the containing block is the initial
containing block.

In the case of IE7B2: 17px + 0 + 0 + 0 + x + 0 + 0 + 0 + 17px = 30em
and thus x = width of divs = 30em - 34px. The 30em is the content
width of the containing block and does NOT include padding and the the
resulting width of the divs cause the anomaly seen in IE7B2. This
conflicts with the spec because "the containing block is formed by the
padding edge of the ancestor" and NOT the content edge.

In the case of FF1.5 and Opera9P2: 17px + 0 + 0 + 0 + x + 0 + 0 + 0 +
17px = 30em + 2em and thus x = 30em + 2em - 34px. The 30em + 2em is
the content width of the containing block along with the padding on
both sides thus the containing block formed follows the spec and IS
the padding edge of the ancestor.

Or I have I overlooked (or misunderstood) a part of the spec?
--
Tom
http://the.kid.who.hacked.in/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: