| 186 | if (element.offsetParent === null || style.visibility === 'hidden' || style.display === 'none' || box.width < 1 || box.height < 1) continue; |
| 187 | if (canvas && (box.right < canvas.left || box.left > canvas.right || box.bottom < canvas.top || box.top > canvas.bottom)) continue; |
| 188 | const side = (name) => (parseFloat(style.getPropertyValue(`padding-${name}`)) || 0) + (parseFloat(style.getPropertyValue(`border-${name}-width`)) || 0); |
| 189 | const text = { left: box.left + side('left'), right: box.right - side('right'), top: box.top + side('top'), bottom: box.bottom - side('bottom') }; |
| 190 | const kind = Object.entries(kinds).find(([name]) => element.classList.contains(name))?.[1] ?? 'label'; |
| 191 | const strong = element.querySelector('strong') ?? element; |