(page)
| 707 | * Bericht ueber ihn waere ein Bericht ueber einen Bildschirm, den es nicht gibt. |
| 708 | */ |
| 709 | export async function tooltipTriggers(page) { |
| 710 | return page.evaluate(() => { |
| 711 | const out = []; |
| 712 | let index = 0; |
| 713 | for (const node of document.querySelectorAll('[data-hint]')) { |
| 714 | const rect = node.getBoundingClientRect(); |
| 715 | const style = window.getComputedStyle(node); |
| 716 | const seen = rect.width > 0 && rect.height > 0 |
| 717 | && style.display !== 'none' && style.visibility !== 'hidden' |
| 718 | && Number(style.opacity) >= 0.05 |
| 719 | && rect.bottom > 0 && rect.top < window.innerHeight |
| 720 | && rect.right > 0 && rect.left < window.innerWidth; |
| 721 | node.setAttribute('data-hint-index', String(index)); |
| 722 | if (seen) { |
| 723 | out.push({ |
| 724 | index, |
| 725 | name: node.getAttribute('data-hint-name') ?? '', |
| 726 | text: node.getAttribute('data-hint') ?? '', |
| 727 | tag: node.tagName.toLowerCase(), |
| 728 | focusable: node.tabIndex >= 0, |
| 729 | rect: { |
| 730 | x: Math.round(rect.x), |
| 731 | y: Math.round(rect.y), |
| 732 | width: Math.round(rect.width), |
| 733 | height: Math.round(rect.height), |
| 734 | }, |
| 735 | }); |
| 736 | } |
| 737 | index += 1; |
| 738 | } |
| 739 | return out; |
| 740 | }); |
| 741 | } |
| 742 | |
| 743 | /** |
| 744 | * Einen Tooltip oeffnen und messen, was er verdeckt. |
no test coverage detected