If you have: <!DOCTYPE html> <html> <head> <style type="text/css"> html {margin-left: 10px} body {margin: 0px} </style> </head> <body> <div id="static">static</div> <div id="absolute" style="position:absolute">absolute</div> </body> </html> Then static.offsetLeft is 0. It should be 10, i.e. include the html margin, the same as absolute.offsetLeft. It already includes the html left border and padding and the body left margin and border and padding. This is the way it is in IE8, and it makes sense. In IE7, it only includes the body padding, which is a bug they fixed in IE8.
Created attachment 30668 [details] test case
See also: <http://www.w3.org/TR/cssom-view/#offset-attributes>
Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well?
Another bit of information: Operat matches IE8 here.
(In reply to comment #3) > Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well? As far as I can see from my notes at the time that I filed this bug, I tested it in FF (2 & 3), and found that it did *not* behave this way.
(In reply to comment #5) > (In reply to comment #3) > > Aharon: It appears that FF also behaves this way, up to and including FF4, have you filed a bug against them as well? > > As far as I can see from my notes at the time that I filed this bug, I tested it in FF (2 & 3), and found that it did *not* behave this way. To clarify, I see that FF 3.6.13 (which is what I currently have installed) behaves that way, but according to my notes the version of FF 3 I tested back then did not. Unfortunately, I did not note which version of FF 3 I had used.
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) match with each other in attached test case show following: ___ static absolute static.offsetLeft: 0 (supposed to be 10) absolute.offsetLeft: 10 (supposed to be 10) ___ Do we need to do anything more here as per web-spec or this can be marked as "RESOLVED CONFIGURATION CHANGED"? Thanks!
Nice!