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

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

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Wed, 23 Apr 2008 10:52:54 +0200
Message-ID: <480EF8E6.3010600@disruptive-innovations.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>

Anne van Kesteren wrote:

> document.body.getBoundingClientRect().top - 
> document.documentElement.getBoundingClientRect().top
> or
> document.body.offsetTop - document.documentElement.offsetTop

Excerpt from your own spec : "If A is the HTML body element or does not
have an associated CSS layout box return zero and stop this algorithm".

So document.body.offsetTop is always zero and your last proposal above
does not work.

If only the first one is available, that means that for all elements
but document.body, we use A.offsetTop and for document.body, we use
A.getBoundingClientRect().top ??? That's really inconsistent and

Received on Wednesday, 23 April 2008 08:53:30 UTC

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