diff options
author | John Resig <jeresig@gmail.com> | 2009-11-07 14:57:27 +0100 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-11-07 14:57:27 +0100 |
commit | 9a371e2d93d6e0a70b4c99e2ca44cbe14017fe5c (patch) | |
tree | dec93ca8cdf12eaa71ae89f1da68c1aebacc822a /src/offset.js | |
parent | 339708cda9985aeef947a28bec1354bdfcc2a358 (diff) | |
download | jquery-9a371e2d93d6e0a70b4c99e2ca44cbe14017fe5c.tar.gz jquery-9a371e2d93d6e0a70b4c99e2ca44cbe14017fe5c.zip |
Fixed the case where getComputedStyled was assumed to exist if getBoundingClientRect did (which isn't the case on the Playstation 3). Fixes #5467.
Diffstat (limited to 'src/offset.js')
-rw-r--r-- | src/offset.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/offset.js b/src/offset.js index 7343353b5..8268ce726 100644 --- a/src/offset.js +++ b/src/offset.js @@ -35,13 +35,13 @@ if ( "getBoundingClientRect" in document.documentElement ) { var offsetParent = elem.offsetParent, prevOffsetParent = elem, doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, body = doc.body, defaultView = doc.defaultView, - prevComputedStyle = defaultView.getComputedStyle( elem, null ), + prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; } - computedStyle = defaultView.getComputedStyle(elem, null); + computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; |