mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Pass a &GlobalScope to WebIDL static methods and constructors
This commit is contained in:
parent
1fd470889d
commit
19108aa330
56 changed files with 198 additions and 245 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue