aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/event.rs
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2013-07-30 13:30:24 -0700
committerbors-servo <release+servo@mozilla.com>2013-07-30 13:30:24 -0700
commit0c105b5307bb69e8d43a1c6263b09c1b8e52c355 (patch)
treef69dc2cc92dfdbd5db54c0f7c579b3f65ec43ff2 /src/components/script/dom/event.rs
parentad8fa8b3d75b58102f75848b90ab4721a7cfcfce (diff)
parent5546f2105bea0a3155a1090f3a9a8dfb65c7b47d (diff)
downloadservo-0c105b5307bb69e8d43a1c6263b09c1b8e52c355.tar.gz
servo-0c105b5307bb69e8d43a1c6263b09c1b8e52c355.zip
auto merge of #641 : jdm/servo/htmldoc2, r=jdm
There are several mechanical changes here that make this look more intimidating than it is. DOMStrings are now passed by reference, and Event and Event_ have swapped names. Finally, there are the various places that need to use `document.with_base |doc| { document.foo }` instead of `document.foo`.
Diffstat (limited to 'src/components/script/dom/event.rs')
-rw-r--r--src/components/script/dom/event.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/components/script/dom/event.rs b/src/components/script/dom/event.rs
index 9f9135d23e9..ba83261ac52 100644
--- a/src/components/script/dom/event.rs
+++ b/src/components/script/dom/event.rs
@@ -17,7 +17,7 @@ use script_task::page_from_context;
use std::cast;
-pub enum Event {
+pub enum Event_ {
ResizeEvent(uint, uint),
ReflowEvent,
ClickEvent(uint, Point2D<f32>),
@@ -25,7 +25,7 @@ pub enum Event {
MouseUpEvent(uint, Point2D<f32>),
}
-pub struct Event_ {
+pub struct Event {
wrapper: WrapperCache,
type_: DOMString,
default_prevented: bool,
@@ -34,11 +34,11 @@ pub struct Event_ {
trusted: bool,
}
-impl Event_ {
- pub fn new(type_: DOMString) -> Event_ {
- Event_ {
+impl Event {
+ pub fn new(type_: &DOMString) -> Event {
+ Event {
wrapper: WrapperCache::new(),
- type_: type_,
+ type_: (*type_).clone(),
default_prevented: false,
cancelable: true,
bubbles: true,
@@ -93,11 +93,11 @@ impl Event_ {
}
pub fn InitEvent(&mut self,
- type_: DOMString,
+ type_: &DOMString,
bubbles: bool,
cancelable: bool,
_rv: &mut ErrorResult) {
- self.type_ = type_;
+ self.type_ = (*type_).clone();
self.cancelable = cancelable;
self.bubbles = bubbles;
}
@@ -107,14 +107,14 @@ impl Event_ {
}
pub fn Constructor(_global: @mut Window,
- type_: DOMString,
+ type_: &DOMString,
_init: &EventBinding::EventInit,
- _rv: &mut ErrorResult) -> @mut Event_ {
- @mut Event_::new(type_)
+ _rv: &mut ErrorResult) -> @mut Event {
+ @mut Event::new(type_)
}
}
-impl CacheableWrapper for Event_ {
+impl CacheableWrapper for Event {
fn get_wrappercache(&mut self) -> &mut WrapperCache {
unsafe { cast::transmute(&self.wrapper) }
}
@@ -125,7 +125,7 @@ impl CacheableWrapper for Event_ {
}
}
-impl BindingObject for Event_ {
+impl BindingObject for Event {
fn GetParentObject(&self, cx: *JSContext) -> @mut CacheableWrapper {
let page = page_from_context(cx);
unsafe {
@@ -134,7 +134,7 @@ impl BindingObject for Event_ {
}
}
-impl DerivedWrapper for Event_ {
+impl DerivedWrapper for Event {
fn wrap(&mut self, _cx: *JSContext, _scope: *JSObject, _vp: *mut JSVal) -> i32 {
fail!(~"nyi")
}