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

> > [nit-picking note:]
> > Aren't they forgetting to add the border from the "middle"
> > visited elements?
> Yes, they may be assuming that offsetLeft/Top includes the 
> border; which is true for IE and Opera

Yes, IE includes the border for element traversals up to its
offsetParent but not the border of the offsetParent itself. And, as
the offsetParent's own offset is determined from its border edge,
its border will have to be manually added to the recursive offset sum.
But yes, I understand this is not your primary interest.

> > Are you only looking at the algorithm in the new super-standards
> > mode, or would this also be changed for the "IE7" standards mode
> > in IE8?
> IE8's standards mode is my focus here. Or are you really 
> saying that in IE7 standards mode body.offsetParent != null ?

No, I was asking about your focus. It would be a whole different
reasoning if your task was to change it for both the IE7 and IE8 
rendering modes.

As you will only be (potentially) changing the behaviour for IE8
mode I guess developers and javascript libs may adapt, so I'm not so
worried either way you choose to go. That is, if there is not a lot of
deployed non-standards-based content that will accidentally trigger 
IE8 mode but I guess offset* will not be the worst problem then ;-).

Best regards
Mike

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