mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make WebIDL constructors take a more specific global if possible (fixes #14071)
This commit is contained in:
parent
8af2327e95
commit
973f77c006
17 changed files with 50 additions and 49 deletions
|
@ -16,11 +16,11 @@ 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;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use dom::window::Window;
|
||||
use html5ever_atoms::LocalName;
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::router::ROUTER;
|
||||
|
@ -220,10 +220,10 @@ impl HTMLImageElement {
|
|||
HTMLImageElementBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Image(global: &GlobalScope,
|
||||
pub fn Image(window: &Window,
|
||||
width: Option<u32>,
|
||||
height: Option<u32>) -> Fallible<Root<HTMLImageElement>> {
|
||||
let document = global.as_window().Document();
|
||||
let document = window.Document();
|
||||
let image = HTMLImageElement::new(local_name!("img"), None, &document);
|
||||
if let Some(w) = width {
|
||||
image.SetWidth(w);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue