| 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 async_test((t) => { | |
| 11 window.requestAnimationFrame(() => { | |
| 12 t.step(() => assert_true(input.matches(":focus"), | |
| 13 "Check input mathces ':focus' after being focused
")); | |
| 14 t.step(() => assert_true(input.matches(":focus-within"), | |
| 15 "Check input mathces ':focus-within' after being
focused")); | |
| 16 | |
| 17 input.style.display = "none"; | |
| 18 window.requestAnimationFrame(() => { | |
| 19 t.step(() => assert_false(input.matches(":focus"), | |
| 20 "Check input doesn't math ':focus' after getti
ng 'display: none'")); | |
| 21 t.step(() => assert_false(input.matches(":focus-within"), | |
| 22 "Check input doesn't math ':focus-within' afte
r getting 'display: none'")); | |
| 23 t.done(); | |
| 24 }); | |
| 25 }); | |
| 26 }, "Test ':focus-within' after 'display:none'"); | |
| 27 </script> | |
| OLD | NEW |