зеркало из https://github.com/mozilla/gecko-dev.git
# User Timothy Guan-tin Chien <timdream@gmail.com>
Bug 780487 - [b2g] All |oveflow:hidden| became scrollable, r=roc
This commit is contained in:
Родитель
a7acbe1bfe
Коммит
9959cd6296
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче