40 lines
1.3 KiB
HTML
40 lines
1.3 KiB
HTML
<!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 <summary> has focus will toggle the <details> 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 <display> using Enter key:");
|
|
eventSender.keyDown("\r");
|
|
shouldBeTrue('openAttribute("details")');
|
|
eventSender.keyDown("\r");
|
|
shouldBeFalse('openAttribute("details")');
|
|
|
|
debug("Toggle <display> 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>
|