fix: radio input element don't trigger validity state (#36103)

Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
This commit is contained in:
Jerens Lensun 2025-03-24 03:16:48 +08:00 committed by GitHub
parent 19d5f5f06f
commit efd6e86393
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 17 deletions

View file

@ -2544,8 +2544,10 @@ impl VirtualMethods for HTMLInputElement {
self.upcast::<Element>()
.check_ancestors_disabled_state_for_form_control();
self.validity_state()
.perform_validation_and_update(ValidationFlags::all());
for r in radio_group_iter(self, self.radio_group_name().as_ref()) {
r.validity_state()
.perform_validation_and_update(ValidationFlags::all());
}
}
fn unbind_from_tree(&self, context: &UnbindContext) {

View file

@ -1,3 +0,0 @@
[radio-valueMissing.html]
[One of the radios is required and another one is checked]
expected: FAIL

View file

@ -2,17 +2,5 @@
[Removed elements are moved into separate radio groups.]
expected: FAIL
[Disconnected radio buttons can serve as radio group containers.]
expected: FAIL
[Shadow roots in disconnected trees can serve as radio group containers.]
expected: FAIL
[Non-HTML elements in disconnected trees can serve as radio group containers.]
expected: FAIL
[Disconnected document fragments can serve as radio group containers.]
expected: FAIL
[Appending input radio input into a disconnect form should update the other radio inputs in the same radio group.]
expected: FAIL