1
2
3
4
5
6
Focusable
Link 1
Link 2
Link 3
Link 4
Link 5
Link 6
Link 7
Focusable
1
2
3
4
5
6
Focusable
Link 1
Link 2
Link 3
Link 4
Link 5
Link 6
Link 7
Focusable
1
2
3
4
5
6
Focusable
Link 1
Link 2
Link 3
Link 4
Link 5
Link 6
Link 7
Focusable
1
2
3
4
5
6
Focusable
Link 1
Link 2
Link 3
Link 4
Link 5
Link 6
Link 7
Focusable
{"ScriptPreparationCode":"var target = document.getElementById(\u0027target\u0027);\r\n\r\nfunction getCandidates(target) {\r\n var candidates = [];\r\n \r\n var children = target.children;\r\n \r\n for (var element of children) {\r\n if (element.tabIndex \u003E= 0 \u0026\u0026 (element.disabled === undefined || element.disabled === false) \u0026\u0026 element.inert === false) {\r\n if (element.tagName === \u0027A\u0027 \u0026\u0026 element.getAttribute(\u0027href\u0027) === null) {\r\n\t\tcontinue;\r\n }\r\n\r\n candidates.push(element);\r\n }\r\n \r\n if (element.childElementCount) {\r\n candidates = candidates.concat(getCandidates(element));\r\n }\r\n }\r\n \r\n return candidates;\r\n}","TestCases":[{"Name":"for loop","Code":"getCandidates(target);","IsDeferred":false},{"Name":"querySelectorAll","Code":"const candidates = Array.from(target.querySelectorAll(\r\n \u0027a[href], button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), details, [tabindex]:not([tabindex=\u0022-1\u0022])\u0027\r\n));\r\n\r\ncandidates.filter((candidate) =\u003E candidate.inert === false);","IsDeferred":false}]}