mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-06 19:35:45 +01:00
Fix gi scrolling issue.
This commit is contained in:
@@ -285,9 +285,9 @@ var DOM = Class("DOM", {
|
|||||||
return {
|
return {
|
||||||
width: this[0].clientWidth,
|
width: this[0].clientWidth,
|
||||||
height: this[0].clientHeight,
|
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,
|
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
|
get right() this.left + this.width
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -448,6 +448,8 @@ var DOM = Class("DOM", {
|
|||||||
* representation of this node.
|
* representation of this node.
|
||||||
*/
|
*/
|
||||||
repr: function repr(color) {
|
repr: function repr(color) {
|
||||||
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
|
|
||||||
function namespaced(node) {
|
function namespaced(node) {
|
||||||
var ns = DOM.namespaceNames[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0];
|
var ns = DOM.namespaceNames[node.namespaceURI] || /^(?:(.*?):)?/.exec(node.name)[0];
|
||||||
if (!ns)
|
if (!ns)
|
||||||
@@ -723,7 +725,7 @@ var DOM = Class("DOM", {
|
|||||||
if (rect)
|
if (rect)
|
||||||
for (let parent in this.ancestors.items) {
|
for (let parent in this.ancestors.items) {
|
||||||
let isect = util.intersection(rect, parent.viewport);
|
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)
|
if (force)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -731,8 +733,8 @@ var DOM = Class("DOM", {
|
|||||||
let win = this.document.defaultView;
|
let win = this.document.defaultView;
|
||||||
|
|
||||||
if (force || !(rect && rect.bottom <= win.innerHeight && rect.top >= 0 && rect.left < win.innerWidth && rect.right > 0))
|
if (force || !(rect && rect.bottom <= win.innerHeight && rect.top >= 0 && rect.left < win.innerWidth && rect.right > 0))
|
||||||
elem.scrollIntoView(arguments.length ? alignWithTop
|
elem.scrollIntoView(alignWithTop !== undefined ? alignWithTop
|
||||||
: Math.abs(rect.top) < Math.abs(win.innerHeight - rect.bottom));
|
: Math.abs(rect.top) < Math.abs(win.innerHeight - rect.bottom));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
Reference in New Issue
Block a user