aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2014-06-01 17:27:35 +0900
committerTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2014-06-02 00:38:57 +0900
commit93f8ae4cf0325eff01885731f1b9cbc52e17ff38 (patch)
treed7922d3e44a2f3dc187e05761e5c7eef6b052642 /src
parentb38f39ebe447e019283e6a684be7e019da55f092 (diff)
downloadservo-93f8ae4cf0325eff01885731f1b9cbc52e17ff38.tar.gz
servo-93f8ae4cf0325eff01885731f1b9cbc52e17ff38.zip
Make UIEvent.view be in a Cell.
Diffstat (limited to 'src')
-rw-r--r--src/components/script/dom/uievent.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/script/dom/uievent.rs b/src/components/script/dom/uievent.rs
index 66ec8e26e70..4cbad225ef3 100644
--- a/src/components/script/dom/uievent.rs
+++ b/src/components/script/dom/uievent.rs
@@ -13,11 +13,12 @@ use dom::window::Window;
use servo_util::str::DOMString;
use serialize::{Encoder, Encodable};
+use std::cell::Cell;
#[deriving(Encodable)]
pub struct UIEvent {
pub event: Event,
- pub view: Option<JS<Window>>,
+ pub view: Cell<Option<JS<Window>>>,
pub detail: i32
}
@@ -31,7 +32,7 @@ impl UIEvent {
pub fn new_inherited(type_id: EventTypeId) -> UIEvent {
UIEvent {
event: Event::new_inherited(type_id),
- view: None,
+ view: Cell::new(None),
detail: 0
}
}
@@ -86,7 +87,7 @@ pub trait UIEventMethods {
impl<'a> UIEventMethods for JSRef<'a, UIEvent> {
fn GetView(&self) -> Option<Temporary<Window>> {
- self.view.map(|view| Temporary::new(view))
+ self.view.get().map(|view| Temporary::new(view))
}
fn Detail(&self) -> i32 {