See attached testcase where it should set the offsetLeft value with the size of the 50px border of the parent it does not take this in account.
In Safari 2.0.4 it works correctly,
tested on Windows XP, Mac OSX 10.4.10 and Mac OSX 10.5
Created attachment 15649 [details]
(In reply to comment #1)
> Created an attachment (id=15649) 
So the test case passes if "border - left:78" is printed, but fails if "border - left:28" is printed?
Firefox 18.104.22.168 and Safari 3.0 (522.12) + WebKit r24534 print "border - left:28".
Opera 9.21 and Safari 2.0.4 (419.3) + original WebKit print "border -left:78".
What does MSIE 6/7 print?
Confirming difference between Safari 2.0 and Safari 3.0 + ToT WebKit, but I'm not sure if this is a regression or not. (Assuming it is for now.)
I Agree that the change isnt a regression if this was intented. The problem is part of a bigger issue: measurement of layout,
- IE has getBoundingClientRect() (offsetTop / offsetLeft is not reliable)
- Gecko has getBoxObjectFor() (offsetTop / offsetLeft is not reliable)
- Opera / Webkit have offsetTop / offsetLeft / offsetParent working reliable.
In Safari 2 and Opera 9 the behavior is like expected, the 'offsetLeft' of the elements summed together is the value in pixels the element is positioned from the left side of the screen (78px).
In Safari 3 this changed, sure their can be an exception added for Safari 3 but it would be quite annoying if in Safari 3.0.1. the behavior is different again,.
That's why i reporting this bug as a regression, a lot of frameworks / toolkits which use 'offset' properties to measure position need to implement specific Safari 3 code
(In reply to comment #2)
> So the test case passes if "border - left:78" is printed, but fails if "border
> - left:28" is printed?
Yes, per Comment #4.
Bug 13237, Comment #10:
Comment #10 From Dave Hyatt 2007-07-24 04:08 PDT [reply]
offsetLeft/Top are relative to your offsetParent. I would guess we had
offsetParent wrong. The goal here is to match IE. What does IE return here?
I think the behavior of IE should not be matched with offsetParent / left / top. IE is complete buggy concerning to offsetParent / Left / Top (e.g. when mixing border / padding / margin / box-model / position / overflow) and though not reliable.
Better would be to keep matching Safari 2.0.4 (was working fine except for TR elements but that is solved) and Opera 9.x (i remember a discussion on the Opera lists a while ago, see: http://dump.testsuite.org/2006/dom/style/offset/spec)
In Safari 3.0 we are matching Firefox offset behavior on purpose, see bug 12687. I think this should be changed now.
I meant to say that this should _not_ be changed now.
In Radar, Dave Hyatt agrees that this should not be changed. Setting to WONTFIX