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