Bug 824472 - Traverse containing frames when looking for scrollable content for browser elements. r=schien

This commit is contained in:
Josh Matthews 2013-01-14 18:03:32 +01:00
parent 122785b394
commit d9e184597f

View File

@ -338,6 +338,10 @@ const ContentPanning = {
return nodeContent;
}
if (nodeContent.frameElement) {
return this._findPannable(nodeContent.frameElement);
}
return null;
},
@ -383,9 +387,19 @@ const ContentPanning = {
return false;
};
function targetParent(node) {
if (node.parentNode) {
return node.parentNode;
}
if (node.frameElement) {
return node.frameElement;
}
return null;
}
function scroll(delta) {
for (target = content; target;
target = ContentPanning._findPannable(target.parentNode)) {
target = ContentPanning._findPannable(targetParent(target))) {
isScrolling = doScroll(target, delta);
if (isScrolling || !firstScroll) {
break;