mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1569314 - Remove IsOptionDisabled check and add relevant test case. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108005
This commit is contained in:
parent
8165271661
commit
ab2f5aa66a
@ -1495,10 +1495,6 @@ bool HTMLSelectElement::IsValueMissing() const {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsOptionDisabled(option)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -92,4 +92,16 @@ test(function() {
|
||||
select.appendChild(optgroup);
|
||||
assert_true(select.checkValidity(), "If one option within an optgroup or not is selected, the select should be considered valid.");
|
||||
}, "Validation on selects with multiple set");
|
||||
|
||||
test(function() {
|
||||
var select = document.createElement('select');
|
||||
select.required = true;
|
||||
var option = document.createElement('option');
|
||||
option.value = 'test';
|
||||
option.disabled = true;
|
||||
option.selected = true;
|
||||
select.appendChild(option);
|
||||
assert_true(select.checkValidity(), "When a required select has an option that is selected and disabled, the select should be considered valid.");
|
||||
}, "Validation on selects with non-empty disabled option");
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user