historical.html (3240B)
1 <!doctype html> 2 <title>Historical forms features should not be supported</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id=log></div> 6 <form id=form hidden> 7 <label id=label></label> 8 <input id=input> 9 <button id=button></button> 10 <select id=select> 11 <optgroup id=optgroup> 12 <option id=option> 13 </select> 14 <datalist id=datalist></datalist> 15 <textarea id=textarea></textarea> 16 <progress id=progress></progress> 17 <meter id=meter></meter> 18 <fieldset id=fieldset> 19 <legend id=legend></legend> 20 </fieldset> 21 </form> 22 23 <form hidden action="isindex-support.txt" target=isindex_iframe id=isindex_form> 24 <input name=isindex value=x> 25 <iframe name=isindex_iframe id=isindex_iframe></iframe> 26 </form> 27 <script> 28 var tags = ['form', 'label', 'input', 'button', 'select', 'datalist', 29 'optgroup', 'option', 'textarea', 'progress', 'meter', 'fieldset', 'legend']; 30 31 function t(property, tagName) { 32 var tagNames = tagName ? [tagName] : tags; 33 tagNames.forEach(function(tagName) { 34 test(function() { 35 assert_false(property in document.getElementById(tagName)); 36 }, tagName + '.' + property + ' should not be supported'); 37 }); 38 } 39 40 function inputType(type) { 41 test(function() { 42 var input = document.createElement('input'); 43 input.type = type; 44 assert_equals(input.type, 'text'); 45 }, '<input type=' + type + '> should not be supported'); 46 } 47 48 // <input type=range multiple> 49 // added in https://github.com/whatwg/html/commit/1efac390abb3f95df61f2d2ac6c0feb47349d97b 50 // removed in https://github.com/whatwg/html/commit/b598d4f873fb8c27d4b23b033837108edfbc3d75 51 t('valueLow', 'input'); 52 t('valueHigh', 'input'); 53 54 // requestAutoComplete() 55 // added in https://github.com/whatwg/html/commit/321659e4db11228857632487ab72b6959db1ba86 56 // removed in https://github.com/whatwg/html/commit/6a257aae619f85390eee20b47767f34887450fcd 57 t('requestAutocomplete', 'form'); 58 t('onautocomplete', 'form'); 59 t('onautocompleteerror', 'form'); 60 61 // <input type=datetime> 62 // added in WF2 63 // removed in https://github.com/whatwg/html/commit/80ba4fa24e5d3d81a10aa1bbd8a2f72f4bcc3f7c 64 inputType('datetime'); 65 66 // <progress form>, <meter form> 67 // removed in https://github.com/whatwg/html/commit/3814376a311837ddfac229d9a631cd10adf53157 68 t('form', 'progress'); 69 t('form', 'meter'); 70 71 // form.item(), form.namedItem() 72 // removed in https://github.com/whatwg/html/commit/da87ab9009d5aeca95a602e718439e35b00d0731 73 t('item', 'form'); 74 t('namedItem', 'form'); 75 76 // Never specified but implemented in WebKit/Chromium 77 test(() => { 78 assert_false("onsearch" in window); 79 }, "window.onsearch should not be supported"); 80 81 test(() => { 82 assert_false("onsearch" in document); 83 }, "document.onsearch should not be supported"); 84 85 t('onsearch', 'input'); 86 t('incremental', 'input'); 87 88 // <input name=isindex> 89 // removed in https://github.com/whatwg/html/commit/5c44abc734eb483f9a7ec79da5844d2fe63d9c3b 90 async_test(function() { 91 var iframe = document.getElementById('isindex_iframe'); 92 iframe.onload = this.step_func_done(function() { 93 assert_regexp_match(iframe.contentWindow.location.href, /\?isindex=x$/); 94 }); 95 document.getElementById('isindex_form').submit(); 96 }, '<input name=isindex> should not be supported'); 97 </script>