<input type="text" id="end">
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async function() {
// Enable Full Keyboard Access emulation on Mac.
if (navigator.platform.indexOf("Mac") === 0) {
await SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]});
}
const start = document.getElementById("start");
start.focus();
const end = document.getElementById("end");
is(document.activeElement, start, "Focus moved sanely");
let lastActiveElement = start;
let stack = [start];
do {
synthesizeKey("KEY_Tab");
isnot(document.activeElement, lastActiveElement, "Focus should've moved once per tab keypress");
lastActiveElement = document.activeElement;
stack.push(lastActiveElement);
} while (document.activeElement != end)
is(stack.length, document.querySelectorAll("input").length + 1, "Fieldset should be focusable");
do {
let previous = stack.pop();
is(document.activeElement, previous, "Focus should've moved backwards as expected");
synthesizeKey("KEY_Tab", {shiftKey: true});
} while (stack.length);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.