#196 √ resolved
John-David Dalton

Deprecated.js needs the deltaX and deltaY added back.

Reported by John-David Dalton | June 30th, 2008 @ 05:08 PM | in 1.6.0.3

Before the recent patches

http://prototype.lighthouseapp.com/projects/8886/tickets/162-git-element-cumulativeoffset-and-getdimensions-not-working-as-expected

I had initially removed the this.deltaX and this.deltaY compensations because they were
not needed when things were being calculated wrongly (before Sundays patches).
Now that those methods are working this needs to be reverted
(add back the - this.deltaX and this.deltaY).

This will fix Firefox, Opera 9.25. 9.5, Safari 3.

IE will still fail on them but thats a deeper issue (its getting the offsetParent() of 
document.body and adding its offset where it would normally be getting HTML element 
(inconsistent with other browsers and add its offset values which are 0).
It might have something to do with it being an absolutly positioned element. 
(nicks functional tests don't appear off and the dom_test unit test pass).

(deprecated.js)

withinIncludingScrolloffsets: 
function(element, x, y) {
  var offsetcache = Element.cumulativeScrollOffset(element),
  dimensions = Element.getDimensions(element);
  
  this.xcomp = x + offsetcache[0];
  this.ycomp = y + offsetcache[1];

should be:

withinIncludingScrolloffsets: function(element, x, y) {
  var offsetcache = Element.cumulativeScrollOffset(element),
  dimensions = Element.getDimensions(element);
  
  this.xcomp = x + offsetcache[0] - this.deltaX;
  this.ycomp = y + offsetcache[1] - this.deltaY;

Comments and changes to this ticket

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.

Shared Ticket Bins

People watching this ticket

Tags