[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / forms / select-no-name.html
1 <html>
2 <head>
3     <title>Submit</title>
4     <style type="text/css">
5     h2 {
6         display: none;
7         
8     }
9     #pass {
10         background: #0f0;
11     }
12     #fail {
13         background: Red;
14     }
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>
23
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.layoutTestController) {
31     layoutTestController.waitUntilDone();
32     layoutTestController.dumpAsText();
33 }
34
35 function test() {
36     var id = document.getElementById('id');
37     
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;
49             }
50         } else id.disabled = true;
51         
52         if(!/done=true/.test(location.search)) {
53             document.forms[0].submit();
54             return;
55         } 
56         document.getElementById("pass").style.display = "inline-block";
57     }
58     if (window.layoutTestController)
59         layoutTestController.notifyDone();
60 };
61 </script>
62 <p>
63 <a href="javascript:history.back();">reload</a>
64 </p>
65 </body>
66 </html>