blob: 49b1249915985029e0d0417e853c7625599d626d [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
div {
background-color: green;
width: 100px;
height: 100px;
}
.red + div { background-color: red }
</style>
<p>You should see a green square below.</p>
<div id="toRemove" class="red"></div>
<div id="sibling"></div>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(255, 0, 0)", "Background is initially red.");
}, "Initial background color.");
test(() => {
toRemove.className = "";
toRemove.remove();
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(0, 128, 0)", "Background is green after sibling is removed.");
}, "Background color changed after sibling removed.");
</script>