blob: 30cabde1cc1a535808e123b8f770192d3e88bb59 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<p id="description"></p>
<div id="divId">
<form>
<fieldset id="fs">
<button id=button1></button>
<fieldset id=fieldset1><legend id=legend1></legend></fieldset>
<input id=inputhidden type=hidden>
<input id=commoninput type=text>
<input id=inputcommon type=search value=searching>
<input id=inputurl type=url>
<input id=commoninput type=email>
<input id=inputpassword type=password>
<input id=inputdate type=date>
<input id=numberId name=inputcommon type=number value=123>
<input id=inputrange type=range>
<input id=inputcolor type=color>
<input id=inputcheckbox type=checkbox>
<input id=inputcommon type=radio value="inputRadioValue">
<input id=inputfile type=file>
<input id=inputsubmit type=submit>
<input id=inputcommon type=image>
<input id=commoninput type=reset>
<input id=inputcommon type=button value=buttonValue>
<keygen id=keygen1></keygen>
<label id=label1></label>
<meter id=meter1></meter>
<object id=object1></object>
<output id=output1></output>
<progress id=progress1></progress>
<select id=select1>
<optgroup id=optgroup1>group1</optgroup>
<option id=option1>option1</option>
</select>
<textarea id=textarea1></textarea>
</fieldset>
</form>
</div>
<div id="console"></div>
<script>
description("This test that fieldset.elements attribute returns an HTMLCollection and not an HTMLFormControlsCollection.");
debug("");
var owner = document.getElementById('fs');
var elementsList = owner.elements;
shouldBeTrue('elementsList instanceof HTMLCollection');
shouldBeFalse('elementsList instanceof HTMLFormControlsCollection');
shouldBe('elementsList.length', '23');
var inputcommonElement = elementsList.namedItem("inputcommon");
shouldBeFalse('inputcommonElement instanceof RadioNodeList');
shouldBeTrue('inputcommonElement instanceof HTMLInputElement');
</script>
<script src="../../../resources/js-test-post.js"></script>
<script>
var ele = document.getElementById("divId");
ele.parentNode.removeChild(ele);
</script>
</body>
</html>