Index: third_party/WebKit/LayoutTests/fast/selectors/focus-within-display-none.html |
diff --git a/third_party/WebKit/LayoutTests/fast/selectors/focus-within-display-none.html b/third_party/WebKit/LayoutTests/fast/selectors/focus-within-display-none.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..09ef5624ca79b35d245a44f8e35d8d2b2e936e11 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/selectors/focus-within-display-none.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE html> |
+<meta charset="utf-8"> |
+<script src=../../resources/testharness.js></script> |
+<script src=../../resources/testharnessreport.js></script> |
+<input id="input"> |
+<script> |
+ const input = document.getElementById("input"); |
+ input.focus(); |
+ |
+ async_test((t) => { |
+ window.requestAnimationFrame(() => { |
+ t.step(() => assert_true(input.matches(":focus"), |
+ "Check input mathces ':focus' after being focused")); |
+ t.step(() => assert_true(input.matches(":focus-within"), |
+ "Check input mathces ':focus-within' after being focused")); |
+ |
+ input.style.display = "none"; |
+ window.requestAnimationFrame(() => { |
+ t.step(() => assert_false(input.matches(":focus"), |
+ "Check input doesn't math ':focus' after getting 'display: none'")); |
+ t.step(() => assert_false(input.matches(":focus-within"), |
+ "Check input doesn't math ':focus-within' after getting 'display: none'")); |
+ t.done(); |
+ }); |
+ }); |
+ }, "Test ':focus-within' after 'display:none'"); |
+</script> |