Introduce UnbindContext

This holds the context that describes the original node that was removed from a tree
when unbinding from a tree.
This commit is contained in:
Anthony Ramine 2015-10-24 02:58:31 +02:00
parent b63ca94c7f
commit 8f01790f06
10 changed files with 41 additions and 45 deletions

View file

@ -16,7 +16,7 @@ use dom::htmlelement::HTMLElement;
use dom::htmlfieldsetelement::HTMLFieldSetElement;
use dom::htmlformelement::{FormControl, HTMLFormElement};
use dom::htmloptionelement::HTMLOptionElement;
use dom::node::{Node, window_from_node};
use dom::node::{Node, UnbindContext, window_from_node};
use dom::nodelist::NodeList;
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;
@ -196,10 +196,8 @@ impl VirtualMethods for HTMLSelectElement {
self.upcast::<Element>().check_ancestors_disabled_state_for_form_control();
}
fn unbind_from_tree(&self, tree_in_doc: bool) {
if let Some(ref s) = self.super_type() {
s.unbind_from_tree(tree_in_doc);
}
fn unbind_from_tree(&self, context: &UnbindContext) {
self.super_type().unwrap().unbind_from_tree(context);
let node = self.upcast::<Node>();
let el = self.upcast::<Element>();