MCPcopy
hub / github.com/reisxd/TizenTube / isFocusable

Function isFocusable

mods/spatial-navigation-polyfill.js:1002–1007  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 4

navigateFunction · 0.85
spatialNavigationSearchFunction · 0.85
findTargetFunction · 0.85

Calls 6

isAtagWithoutHrefFunction · 0.85
isActuallyDisabledFunction · 0.85
isExpresslyInertFunction · 0.85
isBeingRenderedFunction · 0.85
isScrollableFunction · 0.85
isOverflowFunction · 0.85

Tested by

no test coverage detected