Changeset 257

Show
Ignore:
Timestamp:
12/19/07 20:16:39 (1 year ago)
Author:
ddavis
Message:

the max function returns undef if any values are undef. I wrapped all values passed to max with finiteInt. This fixes window scroll calculations. BugzID:64047

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/common/DOM.js

    r255 r257  
    426426         
    427427        return { 
    428             left: max( w.pageXOffset, de.scrollLeft, b.scrollLeft, w.scrollX ), 
    429             top: max( w.pageYOffset, de.scrollTop, b.scrollTop, w.scrollY
     428            left: max( finiteInt( w.pageXOffset ), finiteInt( de.scrollLeft ), finiteInt( b.scrollLeft ), finiteInt( w.scrollX ) ), 
     429            top: max( finiteInt( w.pageYOffset ), finiteInt( de.scrollTop ), finiteInt( b.scrollTop ), finiteInt( w.scrollY )
    430430        }; 
    431431    }, 
     
    439439        }; 
    440440        /* window scroll is fixed in safari 3; devicePixelRatio is a safari 3 only object */ 
    441         if ( navigator.userAgent.toLowerCase().match(/webkit/) && !window.devicePixelRatio ) { 
     441        if ( window.devicePixelRatio || !navigator.userAgent.toLowerCase().match(/webkit/) ) { 
    442442            var s = DOM.getWindowScroll( window ); 
    443443            pos.x += s.left;