From 0c12aa1d4934d9adcb3169e2fad92dd139e861bc Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 22 Aug 2011 19:16:56 -0400 Subject: [PATCH] Fix gi scrolling issue. --- common/modules/dom.jsm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm index c2a94257..0ca67d74 100644 --- a/common/modules/dom.jsm +++ b/common/modules/dom.jsm @@ -285,9 +285,9 @@ var DOM = Class("DOM", { return { width: this[0].clientWidth, height: this[0].clientHeight, - top: r.top + this[0].clientTop, + top: r.top + this[0].scrollTop + this[0].clientTop, get bottom() this.top + this.height, - left: r.left + this[0].clientLeft, + left: r.left + this[0].scrollLeft + this[0].clientLeft, get right() this.left + this.width } }, @@ -448,6 +448,8 @@ var DOM = Class("DOM", { * representation of this node. */ repr: function repr(color) { + XML.ignoreWhitespace = XML.prettyPrinting = false; + function namespaced(node) { var ns = DOM.namespaceNames[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0]; if (!ns) @@ -723,7 +725,7 @@ var DOM = Class("DOM", { if (rect) for (let parent in this.ancestors.items) { let isect = util.intersection(rect, parent.viewport); - force = isect.width != rect.width || isect.height != rect.height; + force = Math.round(isect.width - rect.width) || Math.round(isect.height - rect.height); if (force) break; } @@ -731,8 +733,8 @@ var DOM = Class("DOM", { let win = this.document.defaultView; if (force || !(rect && rect.bottom <= win.innerHeight && rect.top >= 0 && rect.left < win.innerWidth && rect.right > 0)) - elem.scrollIntoView(arguments.length ? alignWithTop - : Math.abs(rect.top) < Math.abs(win.innerHeight - rect.bottom)); + elem.scrollIntoView(alignWithTop !== undefined ? alignWithTop + : Math.abs(rect.top) < Math.abs(win.innerHeight - rect.bottom)); }); }, }, {