CSSOM View Module, offsetParent attribute clearly states that offsetParent of nodeA when nodeA is a position: fixed element should return null. " If any of the following holds true return null and stop this algorithm: (...) The computed value of the position property for element A is fixed. " http://www.w3.org/TR/cssom-view/#offset-attributes Steps to reproduce: 1- Load provided URL 2- Click the [return document.getElementById("PositionFixedElem").offsetParent] button Actual results in Safari 3.1.1 build 525.17.0 under XP Pro SP3: document.getElementById("PositionFixedElem").offsetParent = [object HTMLBodyElement] Expected results: document.getElementById("PositionFixedElem").offsetParent = null Notes: - Internet Explorer 7, Internet Explorer 8 beta 1 and Opera 9.50 will return null. - I have filed a similar bug at https://bugzilla.mozilla.org/show_bug.cgi?id=434678 I have searched for a duplicate and did not find one. I have not checked the testcase with a webkit trunk nightly build (526+).
I'm seeing this too. WebKit nightly from 13 Jan 2009, OS X 10.5.6.
<rdar://problem/6497927>
Created attachment 26829 [details] Fix for offsetParent, offsetTop, and offsetLeft
Created attachment 26834 [details] Fix for offsetParent, offsetTop, and offsetLeft
The testcase is working on my nightly (r41121). I've bisected it between r40738 and r40771. http://trac.webkit.org/changeset/40769 may be the revision responsible (I don't understand the patch but it has offsetParent in the summary). Bug 24097 was fixed as a regression because of this change. One of them is therefore invalid.
This bug was fixed in changeset http://trac.webkit.org/changeset/40769 but there were no tests to make sure that offsetParent of a fixed element was null. Bug 24107 fixes a related issue caused by the above changeset. In the included patch, there are a number of tests which have coverage on this bug.
When I try the provided testcase with latest stable release Safari 4.0 build 530.17, I get expected results. Resolving as FIXED Thank you Matt! regards, Gérard