 Chromium Code Reviews
 Chromium Code Reviews Issue 2795143004:
  [selectors4] Implement :focus-within pseudo-class  (Closed)
    
  
    Issue 2795143004:
  [selectors4] Implement :focus-within pseudo-class  (Closed) 
  | 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..f3fb758ed192daf926e2aa142819a318910a452d | 
| --- /dev/null | 
| +++ b/third_party/WebKit/LayoutTests/fast/selectors/focus-within-display-none.html | 
| @@ -0,0 +1,22 @@ | 
| +<!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(); | 
| + | 
| + test(() => assert_true(input.matches(":focus")), | 
| + "Check input mathces ':focus' after being focused"); | 
| + test(() => assert_true(input.matches(":focus-within")), | 
| + "Check input mathces ':focus-within' after being focused"); | 
| + | 
| + input.style.display = "none"; | 
| + setTimeout(() => { | 
| + test(() => assert_false(input.matches(":focus")), | 
| + "Check input doesn't math ':focus' after getting 'display: none'"); | 
| + test(() => assert_flase(input.matches(":focus-within")), | 
| 
rune
2017/04/11 09:05:27
assert_flase?
 | 
| + "Check input doesn't math ':focus-within' after getting 'display: none'"); | 
| + }, 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
 | 
| +</script> |