mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 864684 - Prevent two way scrolling if it is not neccessary. r=vingtetun
This commit is contained in:
parent
8509113b9f
commit
5249447d5e
@ -371,13 +371,20 @@ const ContentPanning = {
|
||||
let isScrolling = false;
|
||||
let oldX, oldY, newX, newY;
|
||||
let win, doc, htmlNode, bodyNode;
|
||||
let xScrollable = content.scrollWidth > content.clientWidth;
|
||||
let yScrollable = content.scrollHeight > content.clientHeight;
|
||||
|
||||
function doScroll(node, delta) {
|
||||
if (node instanceof Ci.nsIDOMHTMLElement) {
|
||||
oldX = node.scrollLeft, oldY = node.scrollTop;
|
||||
node.scrollLeft += delta.x;
|
||||
node.scrollTop += delta.y;
|
||||
newX = node.scrollLeft, newY = node.scrollTop;
|
||||
newX = oldX = node.scrollLeft, newY = oldY = node.scrollTop;
|
||||
if (xScrollable) {
|
||||
node.scrollLeft += delta.x;
|
||||
newX = node.scrollLeft;
|
||||
}
|
||||
if (yScrollable) {
|
||||
node.scrollTop += delta.y;
|
||||
newY = node.scrollTop;
|
||||
}
|
||||
return (newX != oldX || newY != oldY);
|
||||
} else if (node instanceof Ci.nsIDOMWindow) {
|
||||
win = node;
|
||||
|
Loading…
Reference in New Issue
Block a user