Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / select-no-name.html
blob4c3f8c02589e1a0cdcf89ab5a030d4098b105220
1 <html>
2 <head>
3 <title>Submit</title>
4 <style type="text/css">
5 h2 {
6 display: none;
9 #pass {
10 background: #0f0;
12 #fail {
13 background: Red;
15 </style>
16 </head>
17 <body onload="test()">
18 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=20184">bug 20184</a>:
19 SELECT with no name generates invalid query string.</p>
20 <form action="">
21 <select><option disabled>invalid</option></select>
22 <select><option disabled></option></select>
24 <input type='hidden' id="done" name="done" value="true"/>
25 <input type="hidden" id="id" name="id" value="123"/>
26 </form>
27 <h2 id="pass">PASS</h2>
28 <h2 id="fail">FAIL</h2>
29 <script type="text/javascript">
30 if (window.testRunner) {
31 testRunner.waitUntilDone();
32 testRunner.dumpAsText();
35 function test() {
36 var id = document.getElementById('id');
38 // Options with "disabled" or "invalid" value
39 // are are failures here.
40 if(location.search && /invalid|disabled/.test(location.search)) {
41 document.getElementById("fail").style.display = "inline-block";
42 } else {
43 if(location.search) {
44 var m = location.search.match(/id=(\d+)/);
45 if(m && m[1]) {
46 id.value = m[1];
47 } else {
48 id.disabled = true;
50 } else id.disabled = true;
52 if(!/done=true/.test(location.search)) {
53 document.forms[0].submit();
54 return;
56 document.getElementById("pass").style.display = "inline-block";
58 if (window.testRunner)
59 testRunner.notifyDone();
61 </script>
62 <p>
63 <a href="javascript:history.back();">reload</a>
64 </p>
65 </body>
66 </html>