| 472 | |
| 473 | /** Wo jeder scrollbare Bereich steht. Wortgleich mit smoke-w8 und smoke-w9. */ |
| 474 | const scrollState = (page) => |
| 475 | page.evaluate(() => { |
| 476 | const regions = []; |
| 477 | for (const node of document.body.querySelectorAll('*')) { |
| 478 | if (node.closest('.monaco-editor') !== null) { |
| 479 | continue; |
| 480 | } |
| 481 | const style = globalThis.getComputedStyle(node); |
| 482 | const scrollsY = (style.overflowY === 'auto' || style.overflowY === 'scroll') |
| 483 | && node.scrollHeight > node.clientHeight + 1; |
| 484 | const scrollsX = (style.overflowX === 'auto' || style.overflowX === 'scroll') |
| 485 | && node.scrollWidth > node.clientWidth + 1; |
| 486 | if (!scrollsY && !scrollsX) { |
| 487 | continue; |
| 488 | } |
| 489 | regions.push({ |
| 490 | name: node.getAttribute('data-testid') |
| 491 | ?? (node.getAttribute('class') ?? '').split(/\s+/).filter(Boolean)[0] |
| 492 | ?? node.tagName.toLowerCase(), |
| 493 | top: Math.round(node.scrollTop), |
| 494 | left: Math.round(node.scrollLeft), |
| 495 | hidden: Math.round(node.scrollHeight - node.clientHeight), |
| 496 | }); |
| 497 | } |
| 498 | return { regions, atRest: regions.every((region) => region.top <= 1 && region.left <= 1) }; |
| 499 | }); |
| 500 | |
| 501 | /** |
| 502 | * Ein Beweisbild im Ruhezustand. |