| 599 | |
| 600 | /** Wo jeder scrollbare Bereich steht. Wortgleich mit smoke-w9/w10/w11a. */ |
| 601 | const scrollState = (page) => |
| 602 | page.evaluate(() => { |
| 603 | const regions = []; |
| 604 | for (const node of document.body.querySelectorAll('*')) { |
| 605 | if (node.closest('.monaco-editor') !== null) { |
| 606 | continue; |
| 607 | } |
| 608 | const style = globalThis.getComputedStyle(node); |
| 609 | const scrollsY = (style.overflowY === 'auto' || style.overflowY === 'scroll') |
| 610 | && node.scrollHeight > node.clientHeight + 1; |
| 611 | const scrollsX = (style.overflowX === 'auto' || style.overflowX === 'scroll') |
| 612 | && node.scrollWidth > node.clientWidth + 1; |
| 613 | if (!scrollsY && !scrollsX) { |
| 614 | continue; |
| 615 | } |
| 616 | regions.push({ |
| 617 | name: node.getAttribute('data-testid') |
| 618 | ?? (node.getAttribute('class') ?? '').split(/\s+/).filter(Boolean)[0] |
| 619 | ?? node.tagName.toLowerCase(), |
| 620 | top: Math.round(node.scrollTop), |
| 621 | left: Math.round(node.scrollLeft), |
| 622 | hidden: Math.round(node.scrollHeight - node.clientHeight), |
| 623 | }); |
| 624 | } |
| 625 | return { regions, atRest: regions.every((region) => region.top <= 1 && region.left <= 1) }; |
| 626 | }); |
| 627 | |
| 628 | // ------------------------------------------------------------ Klickstrecke --- |
| 629 | |