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: Thu, 24 Apr 2008 01:23:05 +0200
Message-ID: <BAY116-DAV710511FBC0C7F6869D17AA4E30@phx.gbl>
To: "'Sylvain Galineau'" <sylvaing@microsoft.com>
Cc: "'Www-style'" <www-style@w3.org>
Message-ID: <01d301c8a598$fb64fa10$0a01a8c0@mikedeskxp>

> > [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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:05 GMT