Make reflect_dom_object take a &GlobalScope

This commit is contained in:
Anthony Ramine 2016-09-27 13:16:41 +02:00
parent 093b189b48
commit fcb59d3057
132 changed files with 488 additions and 407 deletions

View file

@ -12,6 +12,7 @@ use dom::bindings::js::{MutHeapJSVal, Root};
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::str::DOMString;
use dom::event::Event;
use dom::globalscope::GlobalScope;
use js::jsapi::{HandleValue, JSContext};
use js::jsval::JSVal;
use string_cache::Atom;
@ -32,13 +33,13 @@ impl PopStateEvent {
}
}
pub fn new_uninitialized(global: GlobalRef) -> Root<PopStateEvent> {
pub fn new_uninitialized(global: &GlobalScope) -> Root<PopStateEvent> {
reflect_dom_object(box PopStateEvent::new_inherited(),
global,
PopStateEventBinding::Wrap)
}
pub fn new(global: GlobalRef,
pub fn new(global: &GlobalScope,
type_: Atom,
bubbles: bool,
cancelable: bool,
@ -58,7 +59,7 @@ impl PopStateEvent {
type_: DOMString,
init: &PopStateEventBinding::PopStateEventInit)
-> Fallible<Root<PopStateEvent>> {
Ok(PopStateEvent::new(global,
Ok(PopStateEvent::new(global.as_global_scope(),
Atom::from(type_),
init.parent.bubbles,
init.parent.cancelable,