blob: 4cc1d297d2d2e921b88594a78568c9eb6618080a (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
<script>
function extractValues()
{
var rows = document.getElementById("table").rows;
for (var i = 0; i< rows.length; i++) {
var row = rows[i];
var element = row.childNodes[1].firstChild;
try {
if (element.value) {
row.childNodes[2].innerHTML = element.value;
}
if (element.getAttribute("value")) {
row.childNodes[3].innerHTML = element.getAttribute("value");
}
} catch (exception) { }
}
}
function test()
{
var e;
document.getElementById("1").value = "after";
document.getElementById("9").value = "after";
document.getElementById("2").value = "after";
document.getElementById("5").value = "after";
document.getElementById("6").value = "after";
document.getElementById("7").value = "after";
document.getElementById("8").value = "after";
document.getElementById("3").setAttribute("value", "after");
document.getElementById("4").setAttribute("value", "after");
try {
e = document.getElementById("12");
e.value = "after";
e.type = "checkbox";
} catch (exception) { }
try {
e = document.getElementById("13");
e.value = "after";
e.type = "text";
} catch (exception) { }
try {
e = document.getElementById("14");
e.setAttribute("value", "after");
e.type = "checkbox";
} catch (exception) { }
try {
e = document.getElementById("15");
e.setAttribute("value", "after");
e.type = "text";
} catch (exception) { }
try {
document.getElementById("10").value = "after";
} catch (exception) { }
extractValues();
document.getElementById("form").reset();
}
</script>
<body onload="test()">
<p>Results that match WinIE are two columns on the right that say "after" every time, except for the last row which should have nothing in either column.</p>
<p>Results that match Gecko are like WinIE, but with "before" for the attribute in the first two rows and the last row.</p>
<hr>
<form id="form">
<table id="table">
<thead><th align="left">test case</th><th align="left">form element</th><th>property</th><th>attribute</th></thead>
<tr><td>text with value property changed</td><td><input id="1" value="before"></td><td ></td><td></td></tr>
<tr><td>password with value property changed</td><td><input id="9" type="password" value="before"></td><td></td><td></td></tr>
<tr><td>check box with value property changed</td><td><input id="2" type="checkbox" value="before"></td><td></td><td></td></tr>
<tr><td>hidden with value property changed</td><td><input id="5" type="hidden" value="before"></td><td></td><td></td></tr>
<tr><td>button with value property changed</td><td><input id="6" type="button" value="before"></td><td></td><td></td></tr>
<tr><td>image with value property changed</td><td><input id="7" type="image" value="before"></td><td></td><td></td></tr>
<tr><td>radio with value property changed</td><td><input id="8" type="radio" value="before"></td><td></td><td></td></tr>
<tr><td>text with value attribute changed</td><td><input id="3" value="before"></td><td ></td><td></td></tr>
<tr><td>check box with value attribute changed</td><td><input id="4" type="checkbox" value="before"></td><td></td><td></td></tr>
<tr><td>text with value property changed, then turned into check box</td><td><input id="12" value="before"></td><td ></td><td></td></tr>
<tr><td>check box with value property changed, then turned into text</td><td><input id="13" type="checkbox" value="before"></td><td></td><td></td></tr>
<tr><td>text with value attribute changed, then turned into check box</td><td><input id="14" value="before"></td><td ></td><td></td></tr>
<tr><td>check box with value attribute changed, then turned into text</td><td><input id="15" type="checkbox" value="before"></td><td></td><td></td></tr>
<tr><td>file with value property changed</td><td><input id="10" type="file" value="before"></td><td></td><td></td></tr>
</table>
</form>
</body>
|