Make WebIDL constructors take a more specific global if possible (fixes #14071)

This commit is contained in:
Rohan Prinja 2016-11-10 02:24:01 -05:00 committed by Anthony Ramine
parent 8af2327e95
commit 973f77c006
17 changed files with 50 additions and 49 deletions

View file

@ -12,7 +12,6 @@ use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::{Event, EventBubbles, EventCancelable};
use dom::globalscope::GlobalScope;
use dom::window::Window;
use servo_atoms::Atom;
@ -71,7 +70,7 @@ impl WebGLContextEvent {
event
}
pub fn Constructor(global: &GlobalScope,
pub fn Constructor(window: &Window,
type_: DOMString,
init: &WebGLContextEventInit) -> Fallible<Root<WebGLContextEvent>> {
let status_message = match init.statusMessage.as_ref() {
@ -83,7 +82,7 @@ impl WebGLContextEvent {
let cancelable = EventCancelable::from(init.parent.cancelable);
Ok(WebGLContextEvent::new(global.as_window(),
Ok(WebGLContextEvent::new(window,
Atom::from(type_),
bubbles,
cancelable,