Chromium Code Reviews| Index: LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html |
| diff --git a/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html b/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4c1d8245a4e49a4400e8ca81b9a6946c91aaa660 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler.html |
| @@ -0,0 +1,17 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<body> |
|
esprehn
2015/08/25 07:50:19
I don't think you need the <body>
kochi
2015/08/25 08:04:34
Done.
|
| + <input type="text"> |
| +</body> |
| +<script> |
| +var input = document.querySelector('input'); |
| +input.addEventListener('focus', function(e) { |
| + var focused = document.querySelector(':focus'); |
| + if (e.target === focused) { |
| + testPassed(":focus matches event.target"); |
| + } else { |
| + testFailed(":focus doesn't match event.target"); |
| + } |
| +}, false); |
| +input.focus(); |
| +</script> |