mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
22224242ba
The user can switch to the main <summary> by tab key, and toggle the <details> by either 'space' key or 'enter' key. 'return' key is handled with 'keypress', and the 'space' key is handled with 'keyup' like the HTMLInputElement. MozReview-Commit-ID: HE6IduUGCpj --HG-- extra : rebase_source : 34598d95f35bf6b5bd927457ee09e42eb6ec0a68
21 lines
601 B
HTML
21 lines
601 B
HTML
<!DOCTYPE html>
|
|
<!-- Any copyright is dedicated to the Public Domain.
|
|
- http://creativecommons.org/publicdomain/zero/1.0/ -->
|
|
|
|
<html class="reftest-wait">
|
|
<script>
|
|
function runTest() {
|
|
var summary = document.getElementById("summary");
|
|
// Dispatch 'return' key to the summary element.
|
|
summary.dispatchEvent(new KeyboardEvent("keypress", {"keyCode": 13}));
|
|
document.documentElement.removeAttribute("class");
|
|
}
|
|
</script>
|
|
<body onload="runTest();">
|
|
<details>
|
|
<summary id="summary">Summary</summary>
|
|
<p>This is the details.</p>
|
|
</details>
|
|
</body>
|
|
</html>
|