From: rwldrn Date: Fri, 1 Apr 2011 17:44:23 +0000 (-0400) Subject: [#415] FF3.6 does not allow setting of ClientRect properties - even when rooted in... X-Git-Tag: v0.5~13^2~3^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=88f3bce41eaaea1ed75a668b4908a0c849fd1033;p=popcorn-js.git [#415] FF3.6 does not allow setting of ClientRect properties - even when rooted in a reference --- diff --git a/popcorn.js b/popcorn.js index bb7dfb6..4be0b65 100644 --- a/popcorn.js +++ b/popcorn.js @@ -401,7 +401,8 @@ // Popcorn Object Element Utils position: function() { var media = this.video, - bounds = media.getBoundingClientRect(), + clientRect = media.getBoundingClientRect(), + bounds = {}, doc = media.ownerDocument, docElem = document.documentElement, body = document.body, @@ -412,15 +413,15 @@ clientLeft = docElem.clientLeft || body.clientLeft || 0; // Determine correct scrollTop/Left - scrollTop = (global.pageYOffset && docElem.scrollTop || body.scrollTop ); - scrollLeft = (global.pageXOffset && docElem.scrollLeft || body.scrollLeft); + scrollTop = ( global.pageYOffset && docElem.scrollTop || body.scrollTop ); + scrollLeft = ( global.pageXOffset && docElem.scrollLeft || body.scrollLeft ); // Temp top/left - top = Math.ceil( bounds.top + scrollTop - clientTop ); - left = Math.ceil( bounds.left + scrollLeft - clientLeft ); + top = Math.ceil( clientRect.top + scrollTop - clientTop ); + left = Math.ceil( clientRect.left + scrollLeft - clientLeft ); - for ( var p in bounds ) { - bounds[ p ] = Math.round( bounds[ p ] ); + for ( var p in clientRect ) { + bounds[ p ] = Math.round( clientRect[ p ] ); } return Popcorn.extend({}, bounds, { top: top, left: left });