# User Timothy Guan-tin Chien <timdream@gmail.com>

Bug 780487 - [b2g] All |oveflow:hidden| became scrollable, r=roc
This commit is contained in:
Fabrice Desré 2012-08-07 16:41:41 -07:00
Родитель a7acbe1bfe
Коммит 9959cd6296
1 изменённых файлов: 19 добавлений и 5 удалений

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

@ -117,12 +117,26 @@ const ContentPanning = {
let nodeContent = node.ownerDocument.defaultView;
while (!(node instanceof Ci.nsIDOMHTMLBodyElement)) {
if (node.scrollHeight > node.clientHeight ||
node.scrollWidth > node.clientWidth ||
('scrollLeftMax' in node && node.scrollLeftMax > 0) ||
('scrollTopMax' in node && node.scrollTopMax > 0)) {
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);
let isScrollableTextarea = (node.tagName == 'TEXTAREA' &&
(node.scrollHeight > node.clientHeight ||
node.scrollWidth > node.clientWidth ||
('scrollLeftMax' in node && node.scrollLeftMax > 0) ||
('scrollTopMax' in node && node.scrollTopMax > 0)));
if (isScroll || isAuto || isScrollableTextarea)
return [node, this._generateCallback(node)];
}
node = node.parentNode;
}