Implement RootedReference<T> for Option<JS<T>>

An implementation of RootedReference for Option<JS<T>> based off of
other implementations of RootedReference for Option wrapped types.
This commit is contained in:
Daniel Robertson 2016-02-16 19:38:11 +00:00
parent f0d4c03bd9
commit 7a35ef1555
3 changed files with 10 additions and 3 deletions

View file

@ -812,7 +812,7 @@ impl Activatable for HTMLInputElement {
// We want to restore state only if the element had been changed in the first place
if cache.was_mutable {
let name = self.get_radio_group_name();
match cache.checked_radio.as_ref().map(|t| &*t) {
match cache.checked_radio.r() {
Some(o) => {
// Avoiding iterating through the whole tree here, instead
// we can check if the conditions for radio group siblings apply