summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select/menulist-submit-without-selection.html
blob: 09729099aacf0c22a69ffee3572b359f199ceaa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('A unselected option was submitted as fallback. This behavior was removed by the change of webkit.org/b/35056.');

var parent = document.createElement('div');
document.body.appendChild(parent);
parent.innerHTML = '<form action="">'
    + '<input type=hidden name="submitted" value="true">'
    + '<select name="select">'
    + '<option disabled>Disabled</option>'
    + '</select>'
    + '</form>';

if (window.testRunner)
    testRunner.waitUntilDone();
var query = window.location.search;
if (query.indexOf('submitted=true') == -1) {
    var select = document.getElementsByTagName('select')[0];
    select.selectedIndex = 0;
    document.forms[0].submit();
} else {
    shouldBe('query.indexOf("select=Disabled")', '-1');
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</body>
</html>