blob: 40a81c1103d91995de9ae117247801be76fe5a5a [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>This tests moving a focus across slotted input elements.
To test manually, press Tab key to move the focus from the first input element to the next.</p>
<div id="host">
<input id="first" slot="x">
<input id="second" slot="y">
</div>
<div id="result">FAIL</div>
<script>
document.getElementById('host').attachShadow({mode: 'closed'}).innerHTML = `
<div><slot name=x></slot></div>
<div><slot name=y></slot></div>`;
document.getElementById('first').focus();
const resultElement = document.getElementById('result');
const secondInputElement = document.getElementById('second');
if (window.eventSender) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
eventSender.keyDown('\t');
setTimeout(() => {
resultElement.textContent = document.activeElement == secondInputElement ? 'PASS' : 'FAIL'
testRunner.notifyDone();
}, 1);
}
</script>
</body>
</html>