11 <p>Tests
1-
10 should have a tick at
80%. Tests
11 and
12 should have no ticks.
</p>
14 <h4>Test
1: Changing option value
</h4>
15 <input type=
"range" list=
"list1" />
17 <option id=
"option1">20</option>
21 document
.getElementById("option1").value
= "80";
27 <h4>Test
2: Changing option attribute
</h4>
28 <input type=
"range" list=
"list2" />
30 <option id=
"option2">20</option>
34 document
.getElementById("option2").setAttribute("value", "80");
40 <h4>Test
3: Changing option text content
</h4>
41 <input type=
"range" list=
"list3" />
43 <option id=
"option3">20</option>
47 document
.getElementById("option3").textContent
= "80";
53 <h4>Test
4: Set datalist
</h4>
54 <input type=
"range" id=
"input4" />
60 document
.getElementById("input4").setAttribute("list", "list4");
66 <h4>Test
5: Set another datalist
</h4>
67 <input type=
"range" id=
"input5" list=
"list5-1" />
68 <datalist id=
"list5-1">
71 <datalist id=
"list5-2">
76 document
.getElementById("input5").setAttribute("list", "list5-2");
82 <h4>Test
6: Reassign datalist id
</h4>
83 <input type=
"range" list=
"list6-1" />
84 <datalist id=
"list6-2">
89 document
.getElementById("list6-2").id
= "list6-1";
95 <h4>Test
7: Reassign datalist in front
</h4>
96 <input type=
"range" list=
"list7-2" />
97 <datalist id=
"list7-1">
100 <datalist id=
"list7-2">
105 document
.getElementById("list7-1").id
= "list7-2";
111 <h4>Test
8: Insert datalist in front
</h4>
112 <input type=
"range" list=
"list8-1" />
113 <datalist id=
"list8-1">
118 var e
= document
.createElement("datalist");
119 e
.innerHTML
= "<option>80</option>";
121 var f
= document
.getElementById("list8-1");
122 f
.parentNode
.insertBefore(e
, f
);
128 <h4>Test
9: Insert option
</h4>
129 <input type=
"range" list=
"list9" />
130 <datalist id=
"list9">
134 var e
= document
.createElement("option");
136 document
.getElementById("list9").appendChild(e
);
142 <h4>Test
10: Remove option
</h4>
143 <input type=
"range" list=
"list10" />
144 <datalist id=
"list10">
145 <option id=
"option10">20</option>
150 var e
= document
.getElementById("option10");
151 e
.parentNode
.removeChild(e
);
157 <h4>Test
11: Insert non-datalist in front
</h4>
158 <input type=
"range" list=
"list11" />
159 <datalist id=
"list11">
164 var e
= document
.createElement("div");
166 var f
= document
.getElementById("list11");
167 f
.parentNode
.insertBefore(e
, f
);
173 <h4>Test
12: Remove datalist
</h4>
174 <input type=
"range" list=
"list12" />
175 <datalist id=
"list12">
180 var e
= document
.getElementById("list12");
181 e
.parentNode
.removeChild(e
);
186 <button id=
"button">Run tests.
</button>
189 if (window
.testRunner
)
190 testRunner
.dumpAsTextWithPixelResults();
192 function clickOn(element
)
194 var x
= element
.offsetLeft
+ element
.offsetWidth
/ 2;
195 var y
= element
.offsetTop
+ element
.offsetHeight
/ 2;
196 eventSender
.mouseMoveTo(x
, y
);
197 eventSender
.mouseDown();
198 eventSender
.mouseUp();
199 eventSender
.mouseMoveTo(0, 0);
202 var button
= document
.getElementById("button");
203 button
.onclick = function() {
217 if (window
.eventSender
)