- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Fri, 25 Apr 2008 13:30:20 -0700
- To: "Sylvain Galineau" <sylvaing@microsoft.com>
- Cc: "Mike Wilson" <mikewse@hotmail.com>, Www-style <www-style@w3.org>
On Fri, Apr 25, 2008 at 10:52 AM, Garrett Smith <dhtmlkitchen@gmail.com> wrote: > > On Fri, Apr 25, 2008 at 9:05 AM, Sylvain Galineau > <sylvaing@microsoft.com> wrote: > > [snip] > <!doctype html> > <style> > body { margin:0 } > div { border:10px solid } > div#x { border:20px solid orange; zoom:1 } > > </style> > <div><div id=x></div></div> > > javascript:alert(x.offsetTop + ", " + x.currentStyle.hasLayout) > > IE7 => 10, true > > Shows that the offsetTop includes the parentNode's border-width and > also has a layout. > (Because the offsetParent is not the parentNode; instead, the offsetParent is BODY). hasLayout is irrelevant. > > <!doctype html> > <style> > body { margin:0 } > div { border:10px solid; display: } > div#x { border:20px solid orange; inline-block; } > > </style> > <div><div id=x></div></div> > > > Changing offset* to be useful sounds like a good idea, but since > offset* is complicated by surprises in IE's implementation and bugs in > other implementations, it would not be possible to do it without > breaking sites and adding more confusion to the mess. > > Garrett > > > > Sylvain
Received on Friday, 25 April 2008 20:30:58 UTC