* Decide whether an element is focusable for spatial navigation. * 1. If element is the browsing context (document, iframe), then it's focusable, * 2. If the element is scrollable container (regardless of scrollable axis), then it's focusable, * 3. The value of tabIndex >= 0, then it's focu
(element)
| 1000 | * @see {@link https://html.spec.whatwg.org/multipage/interaction.html#focusable-area} |
| 1001 | */ |
| 1002 | function isFocusable(element) { |
| 1003 | if ((element.tabIndex < 0) || isAtagWithoutHref(element) || isActuallyDisabled(element) || isExpresslyInert(element) || !isBeingRendered(element)) |
| 1004 | return false; |
| 1005 | else if ((!element.parentElement) || (isScrollable(element) && isOverflow(element)) || (element.tabIndex >= 0)) |
| 1006 | return true; |
| 1007 | } |
| 1008 | |
| 1009 | /** |
| 1010 | * Decide whether an element is a tag without href attribute or not. |
no test coverage detected