aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-10-17 15:04:55 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-10-19 09:36:58 +0200
commite8f358d17805cfafa38313a3c2ce66c9c026682e (patch)
treed0ef2f17d7495f00354fdbbd50aad718693cb5c0
parent71dcabfad88d39bb9d9aa8b9264e2634216d8701 (diff)
downloadservo-e8f358d17805cfafa38313a3c2ce66c9c026682e.tar.gz
servo-e8f358d17805cfafa38313a3c2ce66c9c026682e.zip
Do not root InputActivationState::checked_radio
-rw-r--r--components/script/dom/htmlinputelement.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index 51984c73be7..d8cac420b5d 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -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);
}