mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will remove a level of indirection throughout all DOM code. This patch doesn't change methods implemented on JSRef<T> to take `self` rather than `&self`, and it leaves a few other uses of &JSRef, but those changes can be made incrementally.
This commit is contained in:
parent
b8f34bbc51
commit
4fa8725111
126 changed files with 994 additions and 992 deletions
|
@ -52,9 +52,9 @@ impl MessageEvent {
|
|||
let ev = reflect_dom_object(box MessageEvent::new_inherited(data, origin, lastEventId),
|
||||
global,
|
||||
MessageEventBinding::Wrap).root();
|
||||
let event: &JSRef<Event> = EventCast::from_ref(&*ev);
|
||||
let event: JSRef<Event> = EventCast::from_ref(*ev);
|
||||
event.InitEvent(type_, bubbles, cancelable);
|
||||
Temporary::from_rooted(&*ev)
|
||||
Temporary::from_rooted(*ev)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: &GlobalRef,
|
||||
|
@ -68,14 +68,14 @@ impl MessageEvent {
|
|||
}
|
||||
|
||||
impl MessageEvent {
|
||||
pub fn dispatch_jsval(target: &JSRef<EventTarget>,
|
||||
pub fn dispatch_jsval(target: JSRef<EventTarget>,
|
||||
scope: &GlobalRef,
|
||||
message: JSVal) {
|
||||
let messageevent = MessageEvent::new(
|
||||
scope, "message".to_string(), false, false, message,
|
||||
"".to_string(), "".to_string()).root();
|
||||
let event: &JSRef<Event> = EventCast::from_ref(&*messageevent);
|
||||
target.dispatch_event_with_target(None, &*event).unwrap();
|
||||
let event: JSRef<Event> = EventCast::from_ref(*messageevent);
|
||||
target.dispatch_event_with_target(None, event).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue