W3C home > Mailing lists > Public > www-style@w3.org > March 2008

RE: [cssom-view] small update

From: Mike Wilson <mikewse@hotmail.com>
Date: Wed, 19 Mar 2008 12:07:33 +0100
Message-ID: <BAY116-DAV6662E38F178EF09D0C610A4070@phx.gbl>
To: "'Garrett Smith'" <dhtmlkitchen@gmail.com>, "'Www-style'" <www-style@w3.org>
Message-ID: <006701c889b1$6e68ae70$0a01a8c0@mikedeskxp>

Hi Garrett,

> Aside from the bugs that occur in all FF/Op/Saf, there is a 1 clear,
> fundamental difference in the handling of offsetTop/Left when the
> offsetParent in question is BODY with position: relative.
> Insight:
>  For getting the position of an element: using offsetTop:
>  position: relative can be added to the container, BODY. This makes
> body work like a "normal" offsetParent in all browsers except Opera.

That's an interesting find! There are always more details to be 
So, it looks like Opera is the only browser today that is fully 
compatible with CSOMM, others (representing ~99% of traffic) will have 
to change.

> Position: relative on BODY is useful
> It use useful because makes BODY a containing block for absolutely
> positioned children; BODY margin affects absolutely positioned
> children.

I agree totally.

> Sad path:
> If the parentNode is BODY, then (even) if the parentNode has position:
> relative and el has position, then the function will return the
> distance between el and the edge of the document.
> This is how CSSOM defines it, and in reality, it is a problem 
> in Opera.
> How should other browsers adopt this without breaking pages?

I agree with you, Garrett. In this case you want to deal with the BODY
margin separately from the positioned element's relation to its 
offsetParent. It's two different decisions of the layout. It also
fits well with the Containing Block analogy for offsetParent and 

Best regards
Received on Wednesday, 19 March 2008 11:08:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:35 UTC