Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <meta charset="utf-8"> | |
| 3 <script src=../../resources/testharness.js></script> | |
| 4 <script src=../../resources/testharnessreport.js></script> | |
| 5 <input id="input"> | |
| 6 <script> | |
| 7 const input = document.getElementById("input"); | |
| 8 input.focus(); | |
| 9 | |
| 10 test(() => assert_true(input.matches(":focus")), | |
| 11 "Check input mathces ':focus' after being focused"); | |
| 12 test(() => assert_true(input.matches(":focus-within")), | |
| 13 "Check input mathces ':focus-within' after being focused"); | |
| 14 | |
| 15 input.style.display = "none"; | |
| 16 setTimeout(() => { | |
| 17 test(() => assert_false(input.matches(":focus")), | |
| 18 "Check input doesn't math ':focus' after getting 'display: none'"); | |
| 19 test(() => assert_flase(input.matches(":focus-within")), | |
|
rune
2017/04/11 09:05:27
assert_flase?
| |
| 20 "Check input doesn't math ':focus-within' after getting 'display: none' "); | |
| 21 }, 0); | |
|
rune
2017/04/11 09:05:27
Are you sure this won't be flaky?
This is because
rune
2017/04/11 09:15:10
Perhaps using rAF would be more correct?
Also, sh
| |
| 22 </script> | |
| OLD | NEW |