mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision cfada7e6cb379699fa94c7ed8fcb97082327e10c
This commit is contained in:
parent
87e7e3d429
commit
06b00da16b
179 changed files with 6103 additions and 1186 deletions
|
@ -30,6 +30,11 @@
|
|||
<option style="display:none"></option>
|
||||
<option></option>
|
||||
</select>
|
||||
|
||||
<select id=minus-one>
|
||||
<option value=1>1</option>
|
||||
<option value=2>2</option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
@ -38,6 +43,10 @@ function assertSelectedIndex(select, value) {
|
|||
assert_equals(select.options.selectedIndex, value);
|
||||
}
|
||||
|
||||
function assertSelectValue(select, value) {
|
||||
assert_equals(select.value, value);
|
||||
}
|
||||
|
||||
test(function () {
|
||||
var select = document.getElementById('empty');
|
||||
assertSelectedIndex(select, -1);
|
||||
|
@ -120,4 +129,15 @@ test(function () {
|
|||
select.options[1].selected = false;
|
||||
assertSelectedIndex(select, 0);
|
||||
}, "reset to display:none");
|
||||
|
||||
test(function() {
|
||||
var select = document.getElementById("minus-one");
|
||||
assertSelectedIndex(select, 0);
|
||||
|
||||
select.selectedIndex = -1;
|
||||
|
||||
assertSelectedIndex(select, -1);
|
||||
assertSelectValue(select, "");
|
||||
|
||||
}, "set selectedIndex=-1");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue