[cssom-view] padding edge / border edge for offsetTop/offsetLeft?

On Thu, 24 Apr 2008 01:23:05 +0200, Mike Wilson <mikewse@hotmail.com>  
wrote:
>> 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.

Actually, that depends.

Compare the offsetTop/offsetLeft of #x from

<!doctype html>
<style>
  body { margin:0 }
  div { border:10px solid; height:100px; width:100px }
  div#x { border:20px solid orange; height:10px; width:20px }
</style>
<div><div id=x></div></div>

with

<!doctype html>
<style>
  body { margin:0 }
  div { border:10px solid  }
  div#x { border:20px solid orange; height:10px; width:20px }
</style>
<div><div id=x></div></div>

in Internet Explorer.

Since Firefox and Opera always are relative against the border box I think  
reverting this was a mistake. This is exactly the hasLayout dependency I  
was trying to avoid.

Or am I missing something?


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Thursday, 24 April 2008 09:45:21 UTC