(element, checkTabIndex)
| 24670 | element.isVisible === true; // used as a workaround for testing. |
| 24671 | } |
| 24672 | function isElementTabbable(element, checkTabIndex) { |
| 24673 | // If this element is null or is disabled, it is not considered tabbable. |
| 24674 | if (!element || element.disabled) return false; |
| 24675 | var tabIndex = 0; |
| 24676 | var tabIndexAttributeValue = null; |
| 24677 | if (element && element.getAttribute) { |
| 24678 | tabIndexAttributeValue = element.getAttribute("tabIndex"); |
| 24679 | if (tabIndexAttributeValue) tabIndex = parseInt(tabIndexAttributeValue, 10); |
| 24680 | } |
| 24681 | var isFocusableAttribute = element.getAttribute ? element.getAttribute(IS_FOCUSABLE_ATTRIBUTE) : null; |
| 24682 | var isTabIndexSet = tabIndexAttributeValue !== null && tabIndex >= 0; |
| 24683 | var result = !!element && isFocusableAttribute !== "false" && (element.tagName === "A" || element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "SELECT" || isFocusableAttribute === "true" || isTabIndexSet); |
| 24684 | return checkTabIndex ? tabIndex !== -1 && result : result; |
| 24685 | } |
| 24686 | function isElementFocusZone(element) { |
| 24687 | return !!(element && element.getAttribute && !!element.getAttribute(FOCUSZONE_ID_ATTRIBUTE)); |
| 24688 | } |
no outgoing calls
no test coverage detected