diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-04 00:54:05 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 21:35:49 +0200 |
commit | 19108aa3305df2172208c83500f5ac67d2dee104 (patch) | |
tree | d65138e8d1a8723cb30a56f8bd117f580f39438c /components/script/dom/htmlimageelement.rs | |
parent | 1fd470889dd9b4e6c3a871b6b40b50e30114443d (diff) | |
download | servo-19108aa3305df2172208c83500f5ac67d2dee104.tar.gz servo-19108aa3305df2172208c83500f5ac67d2dee104.zip |
Pass a &GlobalScope to WebIDL static methods and constructors
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r-- | components/script/dom/htmlimageelement.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index d96bb0cab3a..489a6821824 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -17,6 +17,7 @@ use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; use dom::eventtarget::EventTarget; +use dom::globalscope::GlobalScope; use dom::htmlelement::HTMLElement; use dom::node::{Node, NodeDamage, document_from_node, window_from_node}; use dom::values::UNSIGNED_LONG_MAX; @@ -225,10 +226,10 @@ impl HTMLImageElement { HTMLImageElementBinding::Wrap) } - pub fn Image(global: GlobalRef, + pub fn Image(global: &GlobalScope, width: Option<u32>, height: Option<u32>) -> Fallible<Root<HTMLImageElement>> { - let document = global.as_global_scope().as_window().Document(); + let document = global.as_window().Document(); let image = HTMLImageElement::new(atom!("img"), None, document.r()); if let Some(w) = width { image.SetWidth(w); |