[] FF3.6 does not allow setting of ClientRect properties - even when rooted in a reference

This commit is contained in:
rwldrn 2011-04-01 13:44:23 -04:00
Родитель b3e8b98898
Коммит 88f3bce41e
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -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 });