OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 div { |
| 6 background-color: green; |
| 7 width: 100px; |
| 8 height: 100px; |
| 9 } |
| 10 .red + div { background-color: red } |
| 11 </style> |
| 12 <p>You should see a green square below.</p> |
| 13 <div id="toRemove" class="red"></div> |
| 14 <div id="sibling"></div> |
| 15 <script> |
| 16 test(() => { |
| 17 assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(255, 0, 0)
", "Background is initially red."); |
| 18 }, "Initial background color."); |
| 19 |
| 20 test(() => { |
| 21 toRemove.className = ""; |
| 22 toRemove.remove(); |
| 23 assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(0, 128, 0)
", "Background is green after sibling is removed."); |
| 24 }, "Background color changed after sibling removed."); |
| 25 </script> |
OLD | NEW |