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

@ -15,7 +15,7 @@ use dom::element::{AttributeMutation, Element};
use dom::htmlelement::HTMLElement;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlselectelement::HTMLSelectElement;
use dom::node::Node;
use dom::node::{Node, UnbindContext};
use dom::text::Text;
use dom::virtualmethods::VirtualMethods;
use selectors::states::*;
@ -207,10 +207,8 @@ impl VirtualMethods for HTMLOptionElement {
self.pick_if_selected_and_reset();
}
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>();