Ensure that Reflectors are the first field

This commit is contained in:
Manish Goregaokar 2014-12-10 11:56:20 +05:30
parent d761877ef6
commit 21a888341d
14 changed files with 146 additions and 21 deletions

View file

@ -64,3 +64,17 @@ impl<'a> HTMLTitleElementMethods for JSRef<'a, HTMLTitleElement> {
}
}
impl<'a> VirtualMethods for JSRef<'a, HTMLTitleElement> {
fn super_type<'a>(&'a self) -> Option<&'a VirtualMethods> {
let htmlelement: &JSRef<HTMLElement> = HTMLElementCast::from_borrowed_ref(self);
Some(htmlelement as &VirtualMethods)
}
fn bind_to_tree(&self, is_in_doc: bool) {
let node: JSRef<Node> = NodeCast::from_ref(*self);
if is_in_doc {
let document = node.owner_doc().root();
document.send_title_to_compositor()
}
}
}