blob: 7ff41448a6bd303ed34c3ffd65984a2e114a5f5a [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
:checked { background-color: green }
input + div { color: pink }
</style>
<input id="checkbox" type="checkbox"></input>
<div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
description("Use descendant invalidation set for :checked pseudo class.")
var transparent = "rgba(0, 0, 0, 0)";
var green = "rgb(0, 128, 0)";
shouldBe("getComputedStyle(checkbox, '').backgroundColor", "transparent");
checkbox.offsetTop; // Force recalc.
checkbox.checked = true;
if (window.internals)
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
shouldBe("getComputedStyle(checkbox, '').backgroundColor", "green");
</script>