Bug 773356 - Fix scrolling in enabled textareas in B2G. r=roc

Scrolling in disabled textareas still does not work; that's bug 780174.
This commit is contained in:
Justin Lebar 2012-08-03 11:54:33 -04:00
Родитель 0ae46980c5
Коммит b0a3cbdea8
1 изменённых файлов: 5 добавлений и 13 удалений

Просмотреть файл

@ -117,20 +117,12 @@ const ContentPanning = {
let nodeContent = node.ownerDocument.defaultView;
while (!(node instanceof Ci.nsIDOMHTMLBodyElement)) {
let style = nodeContent.getComputedStyle(node, null);
let overflow = [style.getPropertyValue('overflow'),
style.getPropertyValue('overflow-x'),
style.getPropertyValue('overflow-y')];
let rect = node.getBoundingClientRect();
let isAuto = (overflow.indexOf('auto') != -1 &&
(rect.height < node.scrollHeight ||
rect.width < node.scrollWidth));
let isScroll = (overflow.indexOf('scroll') != -1);
if (isScroll || isAuto)
if (node.scrollHeight > node.clientHeight ||
node.scrollWidth > node.clientWidth ||
('scrollLeftMax' in node && node.scrollLeftMax > 0) ||
('scrollTopMax' in node && node.scrollTopMax > 0)) {
return [node, this._generateCallback(node)];
}
node = node.parentNode;
}