mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-03 21:44:11 +01:00
Fix gi scrolling issue.
This commit is contained in:
@@ -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));
|
||||
});
|
||||
},
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user