mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -6,7 +6,6 @@ use dom::bindings::cell::DOMRefCell;
|
|||
use dom::bindings::codegen::Bindings::EventBinding;
|
||||
use dom::bindings::codegen::Bindings::EventBinding::{EventConstants, EventMethods};
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JS, MutNullableHeap, Root};
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
|
@ -131,12 +130,12 @@ impl Event {
|
|||
event
|
||||
}
|
||||
|
||||
pub fn Constructor(global: GlobalRef,
|
||||
pub fn Constructor(global: &GlobalScope,
|
||||
type_: DOMString,
|
||||
init: &EventBinding::EventInit) -> Fallible<Root<Event>> {
|
||||
let bubbles = EventBubbles::from(init.bubbles);
|
||||
let cancelable = EventCancelable::from(init.cancelable);
|
||||
Ok(Event::new(global.as_global_scope(), Atom::from(type_), bubbles, cancelable))
|
||||
Ok(Event::new(global, Atom::from(type_), bubbles, cancelable))
|
||||
}
|
||||
|
||||
pub fn init_event(&self, type_: Atom, bubbles: bool, cancelable: bool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue