(rootElement, currentElement, checkNode, suppressParentTraversal, suppressChildTraversal, includeElementsInFocusZones, allowFocusRoot, tabbable)
| 24643 | return null; |
| 24644 | } |
| 24645 | function getNextElement(rootElement, currentElement, checkNode, suppressParentTraversal, suppressChildTraversal, includeElementsInFocusZones, allowFocusRoot, tabbable) { |
| 24646 | if (!currentElement || currentElement === rootElement && suppressChildTraversal && !allowFocusRoot) return null; |
| 24647 | var isCurrentElementVisible = isElementVisible(currentElement); |
| 24648 | // Check the current node, if it's not the first traversal. |
| 24649 | if (checkNode && isCurrentElementVisible && isElementTabbable(currentElement, tabbable)) return currentElement; |
| 24650 | // Check its children. |
| 24651 | if (!suppressChildTraversal && isCurrentElementVisible && (includeElementsInFocusZones || !(isElementFocusZone(currentElement) || isElementFocusSubZone(currentElement)))) { |
| 24652 | var childMatch = getNextElement(rootElement, currentElement.firstElementChild, true, true, false, includeElementsInFocusZones, allowFocusRoot, tabbable); |
| 24653 | if (childMatch) return childMatch; |
| 24654 | } |
| 24655 | if (currentElement === rootElement) return null; |
| 24656 | // Check its sibling. |
| 24657 | var siblingMatch = getNextElement(rootElement, currentElement.nextElementSibling, true, true, false, includeElementsInFocusZones, allowFocusRoot, tabbable); |
| 24658 | if (siblingMatch) return siblingMatch; |
| 24659 | if (!suppressParentTraversal) return getNextElement(rootElement, currentElement.parentElement, false, false, true, includeElementsInFocusZones, allowFocusRoot, tabbable); |
| 24660 | return null; |
| 24661 | } |
| 24662 | function isElementVisible(element) { |
| 24663 | // If the element is not valid, return false. |
| 24664 | if (!element || !element.getAttribute) return false; |
no test coverage detected