Garrett Smith wrote: > Some confusion must have lead to Anne's assumption that hasLayout > determines this behavior. In fact, that claim is provably false. > > <!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. What Anne has said is correct. You have given hasLayout to wrong element. HasLayout is on the child div#x instead the parent. Reverse that and you may see the difference. <!doctype html> <style> body { margin:0 } div { border:10px solid; zoom:1 } div#x { border:20px solid orange; } </style> <div><div id=x></div></div> AlanReceived on Saturday, 26 April 2008 00:36:35 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:05 GMT