invalid-form-field.html revision 2bde8e466a4451c7319e3a072d118917957d6554
1<!DOCTYPE html> 2<html> 3<head> 4<script src="/js/resources/js-test-pre.js"></script> 5</head> 6<body> 7<div id="test"> 8 <div id="console"></div> 9</body> 10<script> 11window.jsTestIsAsync = true; 12 13var form, input, str; 14 15window.onload = function() 16{ 17 form = document.body.appendChild(document.createElement("form")); 18 form.id = "form"; 19 20 input = document.createElement("input"); 21 input.id = "input"; 22 input.setAttribute("form", "form"); 23 form.elements.namedItem("input"); 24 25 input = null; 26 27 gc(); 28 setTimeout(step2, 100); 29} 30 31function step2() 32{ 33 try { 34 str = typeof form['input'].form; 35 } catch(e) { 36 str = 'threw exception'; 37 } 38 shouldBe("str", "'threw exception'"); 39 finishJSTest(); 40} 41 42window.successfullyParsed = true; 43</script> 44<script src="/js/resources/js-test-post.js"></script> 45</html> 46