import { Device } from "@siteimprove/alfa-device" ; import { Element , Namespace } from "@siteimprove/alfa-dom" ; import { Predicate } from "@siteimprove/alfa-predicate" ; import { isInert } from "./is-inert" ; import { isRendered } from "./is-rendered" ; const { hasName , hasNamespace , hasTabIndex , isDisabled } = Element ; const { and , not } = Predicate ; /**
 *  https export function isTabbable ( device ) { return and ( hasTabIndex ( ( tabIndex ) => tabIndex >= 0 ) , not ( redirectsFocus ) , not ( isDisabled ) , not ( isInert ( device ) ) , isRendered ( device ) ) ; } /**
 * Per the sequential navigation search algorithm, browsing context
 * containers (<iframe> elements) redirect focus to either their first
 * focusable descendant or the next element in the sequential focus
 * navigation order.
 *  https *  https * <label> elements redirect focus to their control.
 *  https const redirectsFocus = and ( hasNamespace ( Namespace . HTML ) , hasName ( "iframe" , "label" ) ) ;