diff options
3 files changed, 6 insertions, 8 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 1999c7193ff..aff8168b8fe 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -1257,6 +1257,7 @@ impl HTMLInputElementMethods<crate::DomTypeHolder> for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#dom-input-checked fn SetChecked(&self, checked: bool) { self.update_checked_state(checked, true); + update_related_validity_states(self, CanGc::note()) } // https://html.spec.whatwg.org/multipage/#dom-input-readonly @@ -1697,7 +1698,7 @@ fn radio_group_iter<'a>( ) -> impl Iterator<Item = DomRoot<HTMLInputElement>> + 'a { root.traverse_preorder(ShadowIncluding::No) .filter_map(DomRoot::downcast::<HTMLInputElement>) - .filter(move |r| &**r == elem || in_same_group(r, form, group, None)) + .filter(move |r| &**r == elem || in_same_group(r, form, group, Some(root))) } fn broadcast_radio_checked(broadcaster: &HTMLInputElement, group: Option<&Atom>) { @@ -2580,6 +2581,9 @@ impl VirtualMethods for HTMLInputElement { self.upcast::<Element>() .check_ancestors_disabled_state_for_form_control(); + if self.input_type() == InputType::Radio { + self.radio_group_updated(self.radio_group_name().as_ref()); + } update_related_validity_states(self, can_gc); } diff --git a/tests/wpt/meta/html/semantics/forms/the-input-element/radio-disconnected-group-owner.html.ini b/tests/wpt/meta/html/semantics/forms/the-input-element/radio-disconnected-group-owner.html.ini index 7d856ecad7b..6dfadc234e7 100644 --- a/tests/wpt/meta/html/semantics/forms/the-input-element/radio-disconnected-group-owner.html.ini +++ b/tests/wpt/meta/html/semantics/forms/the-input-element/radio-disconnected-group-owner.html.ini @@ -1,6 +1,3 @@ [radio-disconnected-group-owner.html] - [Removed elements are moved into separate radio groups.] - expected: FAIL - - [Appending input radio input into a disconnect form should update the other radio inputs in the same radio group.] + [Appending input radio input into a disconnect tree don't update the other radio inputs in the same radio group.] expected: FAIL diff --git a/tests/wpt/meta/html/semantics/forms/the-input-element/radio.html.ini b/tests/wpt/meta/html/semantics/forms/the-input-element/radio.html.ini deleted file mode 100644 index e6320078ac5..00000000000 --- a/tests/wpt/meta/html/semantics/forms/the-input-element/radio.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[radio.html] - [Radio buttons in an orphan tree should make a group] - expected: FAIL |