mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Do not root InputActivationState::checked_radio
This commit is contained in:
parent
71dcabfad8
commit
e8f358d178
1 changed files with 6 additions and 7 deletions
|
@ -758,17 +758,16 @@ impl Activatable for HTMLInputElement {
|
|||
InputType::InputRadio => {
|
||||
// We want to restore state only if the element had been changed in the first place
|
||||
if cache.was_mutable {
|
||||
let old_checked = cache.checked_radio.as_ref().map(|t| t.root());
|
||||
let name = self.get_radio_group_name();
|
||||
match old_checked {
|
||||
Some(ref o) => {
|
||||
match cache.checked_radio.as_ref().map(|t| &*t) {
|
||||
Some(o) => {
|
||||
// Avoiding iterating through the whole tree here, instead
|
||||
// we can check if the conditions for radio group siblings apply
|
||||
if name == o.r().get_radio_group_name() && // TODO should be compatibility caseless
|
||||
self.form_owner() == o.r().form_owner() &&
|
||||
if name == o.get_radio_group_name() && // TODO should be compatibility caseless
|
||||
self.form_owner() == o.form_owner() &&
|
||||
// TODO Both a and b are in the same home subtree
|
||||
o.r().input_type.get() == InputType::InputRadio {
|
||||
o.r().SetChecked(true);
|
||||
o.input_type.get() == InputType::InputRadio {
|
||||
o.SetChecked(true);
|
||||
} else {
|
||||
self.SetChecked(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue