aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/uievent.rs
diff options
context:
space:
mode:
authorMichael Wu <mwu@mozilla.com>2015-04-06 19:27:56 -0400
committerMichael Wu <mwu@mozilla.com>2015-06-19 18:42:48 -0400
commit675267b7822d2d6c30c0e36fc22e0191b741b973 (patch)
tree640b22869e8a7eb7d5657df3074f0b0ccd528c29 /components/script/dom/uievent.rs
parenta256f39796270cd3a5f40f33eaa4e407117b0cc6 (diff)
downloadservo-675267b7822d2d6c30c0e36fc22e0191b741b973.tar.gz
servo-675267b7822d2d6c30c0e36fc22e0191b741b973.zip
Upgrade to SM 39
Diffstat (limited to 'components/script/dom/uievent.rs')
-rw-r--r--components/script/dom/uievent.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/components/script/dom/uievent.rs b/components/script/dom/uievent.rs
index 9c62346ff4a..70ac7e31fac 100644
--- a/components/script/dom/uievent.rs
+++ b/components/script/dom/uievent.rs
@@ -8,8 +8,8 @@ use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
use dom::bindings::codegen::InheritTypes::{EventCast, UIEventDerived};
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
-use dom::bindings::js::{JS, JSRef, MutNullableHeap, Rootable, RootedReference};
-use dom::bindings::js::Temporary;
+use dom::bindings::js::{JS, MutNullableHeap, RootedReference};
+use dom::bindings::js::Root;
use dom::bindings::utils::reflect_dom_object;
use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable};
@@ -42,27 +42,27 @@ impl UIEvent {
}
}
- pub fn new_uninitialized(window: JSRef<Window>) -> Temporary<UIEvent> {
+ pub fn new_uninitialized(window: &Window) -> Root<UIEvent> {
reflect_dom_object(box UIEvent::new_inherited(EventTypeId::UIEvent),
GlobalRef::Window(window),
UIEventBinding::Wrap)
}
- pub fn new(window: JSRef<Window>,
+ pub fn new(window: &Window,
type_: DOMString,
can_bubble: EventBubbles,
cancelable: EventCancelable,
- view: Option<JSRef<Window>>,
- detail: i32) -> Temporary<UIEvent> {
- let ev = UIEvent::new_uninitialized(window).root();
+ view: Option<&Window>,
+ detail: i32) -> Root<UIEvent> {
+ let ev = UIEvent::new_uninitialized(window);
ev.r().InitUIEvent(type_, can_bubble == EventBubbles::Bubbles,
cancelable == EventCancelable::Cancelable, view, detail);
- Temporary::from_rooted(ev.r())
+ ev
}
pub fn Constructor(global: GlobalRef,
type_: DOMString,
- init: &UIEventBinding::UIEventInit) -> Fallible<Temporary<UIEvent>> {
+ init: &UIEventBinding::UIEventInit) -> Fallible<Root<UIEvent>> {
let bubbles = if init.parent.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble };
let cancelable = if init.parent.cancelable {
EventCancelable::Cancelable
@@ -76,10 +76,10 @@ impl UIEvent {
}
}
-impl<'a> UIEventMethods for JSRef<'a, UIEvent> {
+impl<'a> UIEventMethods for &'a UIEvent {
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#widl-UIEvent-view
- fn GetView(self) -> Option<Temporary<Window>> {
- self.view.get().map(Temporary::from_rooted)
+ fn GetView(self) -> Option<Root<Window>> {
+ self.view.get().map(Root::from_rooted)
}
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#widl-UIEvent-detail
@@ -91,15 +91,15 @@ impl<'a> UIEventMethods for JSRef<'a, UIEvent> {
type_: DOMString,
can_bubble: bool,
cancelable: bool,
- view: Option<JSRef<Window>>,
+ view: Option<&Window>,
detail: i32) {
- let event: JSRef<Event> = EventCast::from_ref(self);
+ let event: &Event = EventCast::from_ref(self);
if event.dispatching() {
return;
}
event.InitEvent(type_, can_bubble, cancelable);
- self.view.set(view.map(JS::from_rooted));
+ self.view.set(view.map(JS::from_ref));
self.detail.set(detail);
}
}