Clean up the cast calls

This commit is contained in:
Anthony Ramine 2015-10-07 14:55:02 +02:00
parent 13ea3ac413
commit 68014af78e
66 changed files with 412 additions and 718 deletions

View file

@ -57,8 +57,7 @@ impl HTMLMetaElement {
let content = content.value();
if !content.is_empty() {
if let Some(translated_rule) = ViewportRule::from_meta(&**content) {
let node = self.upcast::<Node>();
let win = window_from_node(node);
let win = window_from_node(self);
let LayoutChan(ref layout_chan) = win.r().layout_chan();
layout_chan.send(Msg::AddMetaViewport(translated_rule)).unwrap();
@ -84,8 +83,7 @@ impl HTMLMetaElementMethods for HTMLMetaElement {
impl VirtualMethods for HTMLMetaElement {
fn super_type(&self) -> Option<&VirtualMethods> {
let htmlelement: &HTMLElement = self.upcast::<HTMLElement>();
Some(htmlelement as &VirtualMethods)
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
}
fn bind_to_tree(&self, tree_in_doc: bool) {