(element: Element)
| 16 | typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype; |
| 17 | |
| 18 | function isStyleVisible(element: Element) { |
| 19 | const windowObject = getOwnerWindow(element); |
| 20 | if ( |
| 21 | !(element instanceof windowObject.HTMLElement) && |
| 22 | !(element instanceof windowObject.SVGElement) |
| 23 | ) { |
| 24 | return false; |
| 25 | } |
| 26 | |
| 27 | let {display, visibility} = element.style; |
| 28 | |
| 29 | let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse'; |
| 30 | |
| 31 | if (isVisible) { |
| 32 | const {getComputedStyle} = getOwnerWindow(element); |
| 33 | let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element); |
| 34 | |
| 35 | isVisible = |
| 36 | computedDisplay !== 'none' && |
| 37 | computedVisibility !== 'hidden' && |
| 38 | computedVisibility !== 'collapse'; |
| 39 | } |
| 40 | |
| 41 | return isVisible; |
| 42 | } |
| 43 | |
| 44 | function isAttributeVisible(element: Element, childElement?: Element) { |
| 45 | return ( |
no test coverage detected