offsetLeft and offsetTop do not include the border width of the parent node if the style property 'position' of the parent is not 'static'. In the test case the style property 'position' is changed from 'static' to 'relative'. This change makes Safari (and Firefox and Chrome) return different offsetLeft and offsetTop values. If you add the border width of 15px to those values you get the correct results again. If you open the test case in Internet Explorer and Opera you'll see that they return the same values no matter what 'position' is set to.
Created attachment 28202 [details] Test case to reproduce the bug
Created attachment 76530 [details] Another testcase
Chromium bug: http://crbug.com/15535 Bug 26020 may also be related to this issue. Looks like this bug (and possibly other bugs related to offsetTop and offsetLeft) are responsible for the inability to use the navigation menus on the following sites in WebKit-based browsers: http://www.doula.co.il http://www.raanana.muni.il/ http://www.osem.co.il/_Contactus/Index.asp?CategoryID=12 http://www.beeper.co.il/?CategoryID=232 http://www.newpan.co.il/ http://www.water.gov.il/ http://www.most.gov.il/ http://www.ono.ac.il/ http://www.shoham.muni.il/ http://www.lehavim.muni.il/ http://www.givat-shmuel.muni.il/ http://www.qiryat-gat.muni.il/ http://www.oryehuda.muni.il/ http://www.efrata.muni.il/ http://www.tel-mond.muni.il/ http://www.kfar-yona.muni.il/ http://www.metar.muni.il/ http://www.gderot.muni.il/ http://www.golan.org.il/ http://www.qatzrin.muni.il/ http://www.beitberl.ac.il http://www.michlalah.edu/ http://www.mishpat.ac.il/ http://www.arihav.com/products/sales/index.asp?category=tools
See also: <http://www.w3.org/TR/cssom-view/#offset-attributes>.
Did you file a Mozilla bug for this?
Created attachment 84938 [details] Modified testcase that prints offsetParent element
Looks like IE8 behaves differently in quirks and standards mode.
Here's the Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=481076
I am unable to reproduce this bug using attached "Modified..." and all browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) shows following: CSS property 'position' of <p> element: static offsetLeft of <span> element: 35 offsetTop of <span> element: 25 Changing CSS property 'position' ... CSS property 'position' of <p> element: relative offsetLeft of <span> element: 20 (should be 35) offsetTop of <span> element: 10 (should be 25) ____ Since all browsers are showing same, do we need to do something more? Thanks!
That sounds like config changed to me.