<!DOCTYPE html>
<html>
<body>
<p>This tests updating the pseudo class state of a radio button in the middle of node insertions.<br>
The test passes if WebKit does not crash or hang.</p>
<div id="result"></div>
<style>
:indeterminate { color: green; }
</style>
<script>

if (window.testRunner)
    testRunner.dumpAsText();

const div = document.createElement('div');

const script = document.createElement('script');
script.textContent = 'window.c = getComputedStyle(input).color; document.getElementById("result").textContent = "PASS"';
div.appendChild(script);

const input = document.createElement('input');
input.type = 'radio';
input.name = 'baz';
input.form = 'foo';
div.appendChild(input);

const input2 = document.createElement('input');
input2.type = 'radio';
input2.name = 'bar';
input2.form = 'foo';
document.body.appendChild(input2);

document.body.appendChild(div);

</script>
</body>
</html>