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

RE: [cssom-view] Why is body's offsetParent null ?

From: Mike Wilson <mikewse@hotmail.com>
Date: Wed, 23 Apr 2008 13:20:11 +0200
Message-ID: <BAY116-DAV11E1DF14C177C886BA92F5A4E30@phx.gbl>
To: "'Anne van Kesteren'" <annevk@opera.com>, "'Www-style'" <www-style@w3.org>
Cc: "'Daniel Glazman'" <daniel.glazman@disruptive-innovations.com>
Message-ID: <016801c8a533$fef36be0$0a01a8c0@mikedeskxp>

Anne van Kesteren wrote:
> On Wed, 23 Apr 2008 12:28:30 +0200, Mike Wilson 
> <mikewse@hotmail.com> wrote:
> > Though, the CSSOM scheme will break down if you want to know the
> > offset to the body element as there is no way to get at this
> > information.
> >
> > In particular, as Garrett pointed out, this offset is available 
> > in all browsers except Opera (and CSSOM) when using 
> > position:relative on the body element:
> > http://www.nabble.com/Re%3A--cssom-view--small-update-p16063070.html
> Following that (special casing position:relative on the HTML 
> body element)  
> would break finding the position of an element within the page, as I  
> explained here:
>    http://lists.w3.org/Archives/Public/www-style/2008Apr/0366.html

That's only the current behaviour of Firefox you're talking about, right? 
The Firefox algorithm is admittedly broken 
and according to Boris Zbarsky they are waiting for your IE reverse-
engineering (done for this spec) before they do any changes or fix the 

The offset behaviour in (standards mode) IE, when you have 
position:relative on the body element, will give you both offset between
body and viewport edge and between body and other elements:
Received on Wednesday, 23 April 2008 11:21:08 UTC

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