<!DOCTYPE html>
<body>
<script src="../../../resources/js-test-pre.js"></script>

<fieldset id="f1" disabled>
  <input required id="i1">
</fieldset>
<fieldset id="f2">
  <input required id="i2">
</fieldset>

<script>
debug('A form control in initially disabled fieldset:');
var control1 = document.getElementById("i1");
shouldBeFalse('control1.willValidate');
debug('Then, enables the fieldset:');
shouldBeTrue('document.getElementById("f1").disabled = false; control1.willValidate');

debug('A form control in initially enabled fieldset:');
var control2 = document.getElementById("i2");
var fieldset2 = document.getElementById("f2");
shouldBeTrue('control2.willValidate');
debug('Then, disables fieldset:');
shouldBeFalse('fieldset2.disabled = true; control2.willValidate');
debug('Detach the form control from the fieldset:');
shouldBeTrue('fieldset2.removeChild(control2); control2.willValidate');

</script>
<script src="../../../resources/js-test-pre.js"></script>
</body>
