blob: ac65d62841b5bb806c9fa88ec57d98543523cd32 [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<details id="details"><summary id="summary"></summary><input></details>
<script>
function openAttribute(id) {
return document.getElementById(id).open;
}
description("This test verifies that pressing the ENTER or SPACEBAR key when the &lt;summary&gt; has focus will toggle the &lt;details&gt; display. On expanding details.open will be true and vice versa.");
if (window.eventSender) {
var summary = document.getElementById("summary");
summary.focus();
shouldBeFalse('openAttribute("details")');
debug("Toggle &lt;display&gt; using Enter key:");
eventSender.keyDown("\r");
shouldBeTrue('openAttribute("details")');
eventSender.keyDown("\r");
shouldBeFalse('openAttribute("details")');
debug("Toggle &lt;display&gt; using Spacebar key:");
eventSender.keyDown(" ");
shouldBeTrue('openAttribute("details")');
eventSender.keyDown(" ");
shouldBeFalse('openAttribute("details")');
} else {
debug('There are tests using eventSender.');
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>