Various fixes for getDimensions, getOffsetParent, clonePosition, cumulativeScrollOffset (of git core)
Reported by Nick Stakenburg | June 12th, 2008 @ 05:05 PM | in 1.6.0.3
I've been getting some emails that my extensions stopped working for people using Prototype from git. Element#cumulativeOffset and Element#getDimensions are causing this.
I've created a page that shows these problems in comparison to the expected results from 1.6.0.2. It could help to fix the issues. I'll also attach it to this ticket.
http://www.nickstakenburg.com/te...
All browsers seem to have problems with getDimensions. IE has problems with cumulativeOffset. I had to revert to the 1.6.0.2 versions of both to fix all issues.
Comments and changes to this ticket
-
Nick Stakenburg June 16th, 2008 @ 10:48 PM
Nice work. The test file seems to render okay. To see if the patch holds up with a real plugin I've created a more extensive test. Comparing 1.6.0.3 from your branch with 1.6.0.2 using prototip.
1.6.0.2: http://www.nickstakenburg.com/te...
1.6.0.3: http://www.nickstakenburg.com/te...
Things have gotten slightly better, but backwards compatibility still seems broken. Positions are slightly off on all browsers. I also noticed a page shift introduced by your patch on IE, hover the 'input', I guess it's heavier on the DOM.
-
Nick Stakenburg June 16th, 2008 @ 11:10 PM
Oh wait, dimensions seem to be okay. Only thing that's introduced is the IE page shift.
Not sure if that's related to this dimension patch though. I've built 1.6.0.3 from your branch but a lot more has changed there since 1.6.0.2.
-
-
John-David Dalton June 16th, 2008 @ 11:38 PM
Ok I narrowed it down to the "cumulativeOffset" method is causing the shift for some reason. I should have it fixed soon enough :P
-
Nick Stakenburg June 16th, 2008 @ 11:41 PM
Was just going to post that :) I guess it's the getOffsetParent.
-
Nick Stakenburg June 17th, 2008 @ 01:14 AM
Perhaps it's not just that one snippet.
It must be the way getOffsetParent and cumulativeOffset have changed. 1.6.0.2 was able to get the same cumulativeOffset without modifying other elements on the page, so it should be possible do handle that better in 1.6.0.3.
I'm sure it's not my code, I'm not doing anything tricky, otherwise I would have noticed the shift in 1.6.0.2.
-
Nick Stakenburg June 17th, 2008 @ 01:48 PM
Reverting to 1.6.0.2 Element#cumulativeOffset fixes the problem, this is because it didn't call Element#getOffsetParent.
The page shift is caused by the two setStyle calls in the snippet you posted above. Those setStyle calls seem harmless but IE messes up layout nevertheless.
I'm not sure what the getOffsetParent in cumulativeOffset fixes, both versions seem to return the same offset.
-
-
John-David Dalton June 25th, 2008 @ 02:08 AM
- no changes were found...
-
John-David Dalton June 25th, 2008 @ 02:09 AM
- no changes were found...
-
John-David Dalton June 25th, 2008 @ 02:09 AM
- no changes were found...
-
John-David Dalton June 25th, 2008 @ 02:10 AM
- no changes were found...
-
-
John-David Dalton June 25th, 2008 @ 08:19 PM
- no changes were found...
-
John-David Dalton June 26th, 2008 @ 03:19 PM
- no changes were found...
-
John-David Dalton June 27th, 2008 @ 03:32 AM
- → Tag changed from to dimensions position
- → Assigned user changed from John-David Dalton to Andrew Dupont
-
Andrew Dupont June 30th, 2008 @ 02:08 AM
- → State changed from bug to resolved
Fixed with the last few commits.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
