(el, x)
| 631 | // scroll | no | YES | YES | YES | |
| 632 | // auto | no | YES | YES | YES | |
| 633 | function overflowingAncestor(el, x) { |
| 634 | let elems = []; |
| 635 | let body = document.body; |
| 636 | let rootScrollHeight = root.scrollHeight; |
| 637 | let rootScrollWidth = root.scrollWidth; |
| 638 | do { |
| 639 | let cached = getCache(el, x); |
| 640 | if (cached) { |
| 641 | return setCache(elems, cached, x); |
| 642 | } |
| 643 | elems.push(el); |
| 644 | if ( |
| 645 | (x && rootScrollWidth === el.scrollWidth) || |
| 646 | (!x && rootScrollHeight === el.scrollHeight) |
| 647 | ) { |
| 648 | let topOverflowsNotHidden = |
| 649 | overflowNotHidden(root, x) && overflowNotHidden(body, x); |
| 650 | let isOverflowCSS = |
| 651 | topOverflowsNotHidden || overflowAutoOrScroll(root, x); |
| 652 | if ( |
| 653 | (isFrame && isContentOverflowing(root, x)) || |
| 654 | (!isFrame && isOverflowCSS) |
| 655 | ) { |
| 656 | return setCache(elems, getScrollRoot(), x); |
| 657 | } |
| 658 | } else if (isContentOverflowing(el, x) && overflowAutoOrScroll(el, x)) { |
| 659 | return setCache(elems, el, x); |
| 660 | } |
| 661 | } while ((el = el.parentElement)); |
| 662 | } |
| 663 | function isContentOverflowing(el, x) { |
| 664 | return x |
| 665 | ? el.clientWidth + 10 < el.scrollWidth |
no test coverage detected