OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>CSS Test: :focus-within selector</title> |
| 6 <link rel="author" title="Ethan Lin" href="mailto:ethlin@mozilla.com"> |
| 7 <link rel="author" title="Mozilla" href="https://www.mozilla.org"> |
| 8 <link rel="help" href="https://drafts.csswg.org/selectors-4/#focus-within-ps
eudo"> |
| 9 <meta name="assert" content="Test checks :focus-within should not apply afte
r element removed."> |
| 10 <link rel="match" href="focus-within-2-ref.html"> |
| 11 <meta name="flags" content="interact"> |
| 12 <style type="text/css"> |
| 13 div { |
| 14 border: solid 15px green; |
| 15 outline: none; |
| 16 } |
| 17 div:focus-within { |
| 18 border-color: red; |
| 19 } |
| 20 </style> |
| 21 </head> |
| 22 <body> |
| 23 <p>Test passes if, when the element is focused and then removed, the outer e
lement should change to green.</p> |
| 24 <div id="parent"> |
| 25 <div id="child" tabindex="1"></div> |
| 26 </div> |
| 27 <script> |
| 28 var child = document.getElementById('child'); |
| 29 child.focus(); |
| 30 document.body.offsetWidth; |
| 31 var parent = document.getElementById("parent"); |
| 32 parent.removeChild(child); |
| 33 document.body.offsetWidth; |
| 34 </script> |
| 35 </body> |
| 36 </html> |
OLD | NEW |