Created
March 24, 2020 20:04
-
-
Save jgraham/24f4dd737060e054d204905ff50e1cea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Focus related events should fire in the correct order</title> | |
<link rel="author" title="Mu-An Chiou" href="http://muan.co"> | |
<link rel="help" href="https://w3c.github.io/uievents/#events-focusevent-event-order"> | |
<script src="/resources/testharness.js"></script> | |
<script src="/resources/testharnessreport.js"></script> | |
<script src="/resources/testdriver.js"></script> | |
<script src="/resources/testdriver-actions.js"></script> | |
<script src="/resources/testdriver-vendor.js"></script> | |
<button type="button" id="fromEl">Focus managemnt from button</button> | |
<button type="button" id="toEl">To button</button> | |
<script> | |
setup({single_test: true}); | |
onload = function() { | |
const from = document.getElementById("fromEl") | |
const to = document.getElementById("toEl") | |
from.addEventListener("keydown", event => { | |
console.log(event); | |
to.focus() | |
}); | |
to.addEventListener("click", event => {console.log(event); assert_unreached();}); | |
from.focus(); | |
let actions = new test_driver.Actions() | |
.keyDown(" ") | |
.keyUp(" ").send().then(() => setTimeout(done, 100)); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment