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

On Wed, 23 Apr 2008 11:40:00 +0200, Daniel Glazman  
<> wrote:
> Anne van Kesteren wrote:
>> No, the way it works is that if offsetParent is equal to the HTML body  
>> element you give the dinstance relative to the initial containing block  
>> origin rather than the HTML body element. This is how non-IE browsers  
>> already function. (That's step 2 in the offsetTop algorithm.)
> I understood how you want it to work in CSS OM View. I'm just saying
> this is not how people are currently using it.

Per the specification this script works exactly as the author intended it  
to work. I'm not sure why you think it doesn't. (That script would not  
work for the HTML body element if that's what you mean, but that's already  
the case in implementations today and therefore I wouldn't expect people  
to rely on that. And if they want that location they're welcome to use  
getBoundingClientRect() instead.)

> That said, I have a comment to make on section 8.1. You wrote:
> "The computed value of the position property of A is static and the
> ancestor is one of the following HTML elements: td, th, or table."
> That means you never return tr or tbody, and that is a problem when
> you deal with multiple tbody inside a single table, or a cell inside
> a footer or header. I would like to know why there is this restriction.
> BTW, we all know that MSIE deeply sucks when querying offset* values on
> a TD or TH, replying zero, so compatibility with existing IE practice is
> unlikely here.

This seemed to be most compatible with existing implementations.

Could you elaborate on why it is problem? I suppose that if we have enough  
use cases we could look into creating a more sophisticated API for the box  
model for the next level of the specification.

Anne van Kesteren

Received on Wednesday, 23 April 2008 09:58:56 UTC