Pass around event types as Atoms instead of Strings

`Event` internally stores the `type` as an `Atom`, and we're `String`s
everywhere, which can cause unnecessary allocations to occur since
they'll end up as `Atom`s anyways.
This commit is contained in:
Corey Farwell 2015-12-10 22:06:05 -05:00
parent 996c0a60b8
commit 4accaf50b2
25 changed files with 156 additions and 135 deletions

View file

@ -12,6 +12,7 @@ use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use script_task::ScriptChan; use script_task::ScriptChan;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -33,7 +34,7 @@ impl CloseEvent {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
wasClean: bool, wasClean: bool,
@ -44,9 +45,9 @@ impl CloseEvent {
let ev = reflect_dom_object(event, global, CloseEventBinding::Wrap); let ev = reflect_dom_object(event, global, CloseEventBinding::Wrap);
{ {
let event = ev.upcast::<Event>(); let event = ev.upcast::<Event>();
event.InitEvent(type_, event.init_event(type_,
bubbles == EventBubbles::Bubbles, bubbles == EventBubbles::Bubbles,
cancelable == EventCancelable::Cancelable); cancelable == EventCancelable::Cancelable);
} }
ev ev
} }
@ -66,7 +67,7 @@ impl CloseEvent {
EventCancelable::NotCancelable EventCancelable::NotCancelable
}; };
Ok(CloseEvent::new(global, Ok(CloseEvent::new(global,
type_, Atom::from(&*type_),
bubbles, bubbles,
cancelable, cancelable,
init.wasClean, init.wasClean,

View file

@ -13,6 +13,7 @@ use dom::bindings::reflector::reflect_dom_object;
use dom::event::Event; use dom::event::Event;
use js::jsapi::{HandleValue, JSContext}; use js::jsapi::{HandleValue, JSContext};
use js::jsval::JSVal; use js::jsval::JSVal;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
// https://dom.spec.whatwg.org/#interface-customevent // https://dom.spec.whatwg.org/#interface-customevent
@ -37,13 +38,13 @@ impl CustomEvent {
CustomEventBinding::Wrap) CustomEventBinding::Wrap)
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: bool, bubbles: bool,
cancelable: bool, cancelable: bool,
detail: HandleValue) detail: HandleValue)
-> Root<CustomEvent> { -> Root<CustomEvent> {
let ev = CustomEvent::new_uninitialized(global); let ev = CustomEvent::new_uninitialized(global);
ev.InitCustomEvent(global.get_cx(), type_, bubbles, cancelable, detail); ev.init_custom_event(global.get_cx(), type_, bubbles, cancelable, detail);
ev ev
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
@ -52,11 +53,26 @@ impl CustomEvent {
init: &CustomEventBinding::CustomEventInit) init: &CustomEventBinding::CustomEventInit)
-> Fallible<Root<CustomEvent>> { -> Fallible<Root<CustomEvent>> {
Ok(CustomEvent::new(global, Ok(CustomEvent::new(global,
type_, Atom::from(&*type_),
init.parent.bubbles, init.parent.bubbles,
init.parent.cancelable, init.parent.cancelable,
unsafe { HandleValue::from_marked_location(&init.detail) })) unsafe { HandleValue::from_marked_location(&init.detail) }))
} }
fn init_custom_event(&self,
_cx: *mut JSContext,
type_: Atom,
can_bubble: bool,
cancelable: bool,
detail: HandleValue) {
let event = self.upcast::<Event>();
if event.dispatching() {
return;
}
self.detail.set(detail.get());
event.init_event(type_, can_bubble, cancelable);
}
} }
impl CustomEventMethods for CustomEvent { impl CustomEventMethods for CustomEvent {
@ -72,12 +88,6 @@ impl CustomEventMethods for CustomEvent {
can_bubble: bool, can_bubble: bool,
cancelable: bool, cancelable: bool,
detail: HandleValue) { detail: HandleValue) {
let event = self.upcast::<Event>(); self.init_custom_event(_cx, Atom::from(&*type_), can_bubble, cancelable, detail)
if event.dispatching() {
return;
}
self.detail.set(detail.get());
event.InitEvent(type_, can_bubble, cancelable);
} }
} }

View file

@ -524,7 +524,7 @@ impl Document {
self.ready_state.set(state); self.ready_state.set(state);
let event = Event::new(GlobalRef::Window(&self.window), let event = Event::new(GlobalRef::Window(&self.window),
DOMString::from("readystatechange"), atom!("readystatechange"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
let target = self.upcast::<EventTarget>(); let target = self.upcast::<EventTarget>();
@ -1326,7 +1326,7 @@ impl Document {
update_with_current_time(&self.dom_content_loaded_event_start); update_with_current_time(&self.dom_content_loaded_event_start);
let event = Event::new(GlobalRef::Window(self.window()), let event = Event::new(GlobalRef::Window(self.window()),
DOMString::from("DOMContentLoaded"), atom!("DOMContentLoaded"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
let doctarget = self.upcast::<EventTarget>(); let doctarget = self.upcast::<EventTarget>();
@ -2464,7 +2464,7 @@ impl DocumentProgressHandler {
let document = self.addr.root(); let document = self.addr.root();
let window = document.window(); let window = document.window();
let event = Event::new(GlobalRef::Window(window), let event = Event::new(GlobalRef::Window(window),
DOMString::from("load"), atom!("load"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
let wintarget = window.upcast::<EventTarget>(); let wintarget = window.upcast::<EventTarget>();

View file

@ -16,6 +16,7 @@ use dom::event::{Event, EventBubbles, EventCancelable};
use js::jsapi::{RootedValue, HandleValue, JSContext}; use js::jsapi::{RootedValue, HandleValue, JSContext};
use js::jsval::JSVal; use js::jsval::JSVal;
use std::cell::Cell; use std::cell::Cell;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -48,7 +49,7 @@ impl ErrorEvent {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
message: DOMString, message: DOMString,
@ -59,8 +60,8 @@ impl ErrorEvent {
let ev = ErrorEvent::new_uninitialized(global); let ev = ErrorEvent::new_uninitialized(global);
{ {
let event = ev.upcast::<Event>(); let event = ev.upcast::<Event>();
event.InitEvent(type_, bubbles == EventBubbles::Bubbles, event.init_event(type_, bubbles == EventBubbles::Bubbles,
cancelable == EventCancelable::Cancelable); cancelable == EventCancelable::Cancelable);
*ev.message.borrow_mut() = message; *ev.message.borrow_mut() = message;
*ev.filename.borrow_mut() = filename; *ev.filename.borrow_mut() = filename;
ev.lineno.set(lineno); ev.lineno.set(lineno);
@ -98,7 +99,7 @@ impl ErrorEvent {
// Dictionaries need to be rooted // Dictionaries need to be rooted
// https://github.com/servo/servo/issues/6381 // https://github.com/servo/servo/issues/6381
let error = RootedValue::new(global.get_cx(), init.error); let error = RootedValue::new(global.get_cx(), init.error);
let event = ErrorEvent::new(global, type_, let event = ErrorEvent::new(global, Atom::from(&*type_),
bubbles, cancelable, bubbles, cancelable,
msg, file_name, msg, file_name,
line_num, col_num, line_num, col_num,

View file

@ -83,11 +83,11 @@ impl Event {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable) -> Root<Event> { cancelable: EventCancelable) -> Root<Event> {
let event = Event::new_uninitialized(global); let event = Event::new_uninitialized(global);
event.InitEvent(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable); event.init_event(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable);
event event
} }
@ -96,7 +96,23 @@ impl Event {
init: &EventBinding::EventInit) -> Fallible<Root<Event>> { init: &EventBinding::EventInit) -> Fallible<Root<Event>> {
let bubbles = if init.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble }; let bubbles = if init.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble };
let cancelable = if init.cancelable { EventCancelable::Cancelable } else { EventCancelable::NotCancelable }; let cancelable = if init.cancelable { EventCancelable::Cancelable } else { EventCancelable::NotCancelable };
Ok(Event::new(global, type_, bubbles, cancelable)) Ok(Event::new(global, Atom::from(&*type_), bubbles, cancelable))
}
pub fn init_event(&self, type_: Atom, bubbles: bool, cancelable: bool) {
if self.dispatching.get() {
return;
}
self.initialized.set(true);
self.stop_propagation.set(false);
self.stop_immediate.set(false);
self.canceled.set(false);
self.trusted.set(false);
self.target.set(None);
*self.type_.borrow_mut() = type_;
self.bubbles.set(bubbles);
self.cancelable.set(cancelable);
} }
#[inline] #[inline]
@ -224,19 +240,7 @@ impl EventMethods for Event {
type_: DOMString, type_: DOMString,
bubbles: bool, bubbles: bool,
cancelable: bool) { cancelable: bool) {
if self.dispatching.get() { self.init_event(Atom::from(&*type_), bubbles, cancelable)
return;
}
self.initialized.set(true);
self.stop_propagation.set(false);
self.stop_immediate.set(false);
self.canceled.set(false);
self.trusted.set(false);
self.target.set(None);
*self.type_.borrow_mut() = Atom::from(&*type_);
self.bubbles.set(bubbles);
self.cancelable.set(cancelable);
} }
// https://dom.spec.whatwg.org/#dom-event-istrusted // https://dom.spec.whatwg.org/#dom-event-istrusted

View file

@ -27,6 +27,7 @@ use script_task::{CommonScriptMsg, Runnable, ScriptChan, ScriptPort};
use std::cell::Cell; use std::cell::Cell;
use std::sync::mpsc; use std::sync::mpsc;
use std::sync::mpsc::Receiver; use std::sync::mpsc::Receiver;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
use util::task::spawn_named; use util::task::spawn_named;
@ -119,10 +120,10 @@ impl FileReader {
let exception = DOMException::new(global.r(), error); let exception = DOMException::new(global.r(), error);
fr.error.set(Some(&exception)); fr.error.set(Some(&exception));
fr.dispatch_progress_event("error".to_owned(), 0, None); fr.dispatch_progress_event(atom!("error"), 0, None);
return_on_abort!(); return_on_abort!();
// Step 3 // Step 3
fr.dispatch_progress_event("loadend".to_owned(), 0, None); fr.dispatch_progress_event(atom!("loadend"), 0, None);
return_on_abort!(); return_on_abort!();
// Step 4 // Step 4
fr.terminate_ongoing_reading(); fr.terminate_ongoing_reading();
@ -141,7 +142,7 @@ impl FileReader {
); );
return_on_abort!(); return_on_abort!();
//FIXME Step 7 send current progress //FIXME Step 7 send current progress
fr.dispatch_progress_event("progress".to_owned(), 0, None); fr.dispatch_progress_event(atom!("progress"), 0, None);
} }
// https://w3c.github.io/FileAPI/#dfn-readAsText // https://w3c.github.io/FileAPI/#dfn-readAsText
@ -157,7 +158,7 @@ impl FileReader {
); );
return_on_abort!(); return_on_abort!();
// Step 6 // Step 6
fr.dispatch_progress_event("loadstart".to_owned(), 0, None); fr.dispatch_progress_event(atom!("loadstart"), 0, None);
} }
// https://w3c.github.io/FileAPI/#dfn-readAsText // https://w3c.github.io/FileAPI/#dfn-readAsText
@ -187,11 +188,11 @@ impl FileReader {
*fr.result.borrow_mut() = Some(output); *fr.result.borrow_mut() = Some(output);
// Step 8.3 // Step 8.3
fr.dispatch_progress_event("load".to_owned(), 0, None); fr.dispatch_progress_event(atom!("load"), 0, None);
return_on_abort!(); return_on_abort!();
// Step 8.4 // Step 8.4
if fr.ready_state.get() != FileReaderReadyState::Loading { if fr.ready_state.get() != FileReaderReadyState::Loading {
fr.dispatch_progress_event("loadend".to_owned(), 0, None); fr.dispatch_progress_event(atom!("loadend"), 0, None);
} }
return_on_abort!(); return_on_abort!();
// Step 9 // Step 9
@ -297,8 +298,8 @@ impl FileReaderMethods for FileReader {
self.terminate_ongoing_reading(); self.terminate_ongoing_reading();
// Steps 5 & 6 // Steps 5 & 6
self.dispatch_progress_event("abort".to_owned(), 0, None); self.dispatch_progress_event(atom!("abort"), 0, None);
self.dispatch_progress_event("loadend".to_owned(), 0, None); self.dispatch_progress_event(atom!("loadend"), 0, None);
} }
// https://w3c.github.io/FileAPI/#dfn-error // https://w3c.github.io/FileAPI/#dfn-error
@ -319,11 +320,11 @@ impl FileReaderMethods for FileReader {
impl FileReader { impl FileReader {
fn dispatch_progress_event(&self, type_: String, loaded: u64, total: Option<u64>) { fn dispatch_progress_event(&self, type_: Atom, loaded: u64, total: Option<u64>) {
let global = self.global.root(); let global = self.global.root();
let progressevent = ProgressEvent::new(global.r(), let progressevent = ProgressEvent::new(global.r(),
DOMString::from(type_), EventBubbles::DoesNotBubble, EventCancelable::NotCancelable, type_, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
total.is_some(), loaded, total.unwrap_or(0)); total.is_some(), loaded, total.unwrap_or(0));
progressevent.upcast::<Event>().fire(self.upcast()); progressevent.upcast::<Event>().fire(self.upcast());
} }
@ -346,7 +347,7 @@ impl FileReader {
let exception = DOMException::new(global.r(), DOMErrorName::InvalidStateError); let exception = DOMException::new(global.r(), DOMErrorName::InvalidStateError);
self.error.set(Some(&exception)); self.error.set(Some(&exception));
self.dispatch_progress_event("error".to_owned(), 0, None); self.dispatch_progress_event(atom!("error"), 0, None);
return Ok(()); return Ok(());
} }

View file

@ -162,7 +162,7 @@ impl HTMLFormElement {
// TODO: Handle browsing contexts // TODO: Handle browsing contexts
// TODO: Handle validation // TODO: Handle validation
let event = Event::new(GlobalRef::Window(win.r()), let event = Event::new(GlobalRef::Window(win.r()),
DOMString::from("submit"), atom!("submit"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable); EventCancelable::Cancelable);
event.fire(self.upcast()); event.fire(self.upcast());
@ -315,7 +315,7 @@ impl HTMLFormElement {
let win = window_from_node(self); let win = window_from_node(self);
let event = Event::new(GlobalRef::Window(win.r()), let event = Event::new(GlobalRef::Window(win.r()),
DOMString::from("reset"), atom!("reset"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable); EventCancelable::Cancelable);
event.fire(self.upcast()); event.fire(self.upcast());

View file

@ -144,7 +144,7 @@ impl HTMLIFrameElement {
let _ar = JSAutoRequest::new(cx); let _ar = JSAutoRequest::new(cx);
let _ac = JSAutoCompartment::new(cx, window.reflector().get_jsobject().get()); let _ac = JSAutoCompartment::new(cx, window.reflector().get_jsobject().get());
let mut detail = RootedValue::new(cx, UndefinedValue()); let mut detail = RootedValue::new(cx, UndefinedValue());
let event_name = DOMString::from(event.name().to_owned()); let event_name = Atom::from(event.name());
self.build_mozbrowser_event_detail(event, cx, detail.handle_mut()); self.build_mozbrowser_event_detail(event, cx, detail.handle_mut());
CustomEvent::new(GlobalRef::Window(window.r()), CustomEvent::new(GlobalRef::Window(window.r()),
event_name, event_name,
@ -210,7 +210,7 @@ impl HTMLIFrameElement {
// Step 4 // Step 4
let window = window_from_node(self); let window = window_from_node(self);
let event = Event::new(GlobalRef::Window(window.r()), let event = Event::new(GlobalRef::Window(window.r()),
DOMString::from("load".to_owned()), atom!("load"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(self.upcast()); event.fire(self.upcast());

View file

@ -78,7 +78,7 @@ impl Runnable for ImageResponseHandlerRunnable {
// Fire image.onload // Fire image.onload
let window = window_from_node(document.r()); let window = window_from_node(document.r());
let event = Event::new(GlobalRef::Window(window.r()), let event = Event::new(GlobalRef::Window(window.r()),
DOMString::from("load"), atom!("load"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(element.upcast()); event.fire(element.upcast());

View file

@ -850,13 +850,13 @@ impl Activatable for HTMLInputElement {
let target = self.upcast(); let target = self.upcast();
let event = Event::new(GlobalRef::Window(win.r()), let event = Event::new(GlobalRef::Window(win.r()),
DOMString::from("input"), atom!("input"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(target); event.fire(target);
let event = Event::new(GlobalRef::Window(win.r()), let event = Event::new(GlobalRef::Window(win.r()),
DOMString::from("change"), atom!("change"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(target); event.fire(target);

View file

@ -478,25 +478,25 @@ impl HTMLScriptElement {
} }
pub fn dispatch_before_script_execute_event(&self) -> bool { pub fn dispatch_before_script_execute_event(&self) -> bool {
self.dispatch_event("beforescriptexecute".to_owned(), self.dispatch_event(atom!("beforescriptexecute"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable) EventCancelable::Cancelable)
} }
pub fn dispatch_after_script_execute_event(&self) { pub fn dispatch_after_script_execute_event(&self) {
self.dispatch_event("afterscriptexecute".to_owned(), self.dispatch_event(atom!("afterscriptexecute"),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
} }
pub fn dispatch_load_event(&self) { pub fn dispatch_load_event(&self) {
self.dispatch_event("load".to_owned(), self.dispatch_event(atom!("load"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
} }
pub fn dispatch_error_event(&self) { pub fn dispatch_error_event(&self) {
self.dispatch_event("error".to_owned(), self.dispatch_event(atom!("error"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
} }
@ -546,15 +546,12 @@ impl HTMLScriptElement {
} }
fn dispatch_event(&self, fn dispatch_event(&self,
type_: String, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable) -> bool { cancelable: EventCancelable) -> bool {
let window = window_from_node(self); let window = window_from_node(self);
let window = window.r(); let window = window.r();
let event = Event::new(GlobalRef::Window(window), let event = Event::new(GlobalRef::Window(window), type_, bubbles, cancelable);
DOMString::from(type_),
bubbles,
cancelable);
event.fire(self.upcast()) event.fire(self.upcast())
} }
} }

View file

@ -238,7 +238,7 @@ impl HTMLTextAreaElement {
let window = window_from_node(self); let window = window_from_node(self);
let window = window.r(); let window = window.r();
let event = Event::new(GlobalRef::Window(window), let event = Event::new(GlobalRef::Window(window),
DOMString::from("input"), atom!("input"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);

View file

@ -15,6 +15,7 @@ use dom::eventtarget::EventTarget;
use js::jsapi::{RootedValue, HandleValue, Heap, JSContext}; use js::jsapi::{RootedValue, HandleValue, Heap, JSContext};
use js::jsval::JSVal; use js::jsval::JSVal;
use std::default::Default; use std::default::Default;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -47,14 +48,14 @@ impl MessageEvent {
reflect_dom_object(ev, global, MessageEventBinding::Wrap) reflect_dom_object(ev, global, MessageEventBinding::Wrap)
} }
pub fn new(global: GlobalRef, type_: DOMString, pub fn new(global: GlobalRef, type_: Atom,
bubbles: bool, cancelable: bool, bubbles: bool, cancelable: bool,
data: HandleValue, origin: DOMString, lastEventId: DOMString) data: HandleValue, origin: DOMString, lastEventId: DOMString)
-> Root<MessageEvent> { -> Root<MessageEvent> {
let ev = MessageEvent::new_initialized(global, data, origin, lastEventId); let ev = MessageEvent::new_initialized(global, data, origin, lastEventId);
{ {
let event = ev.upcast::<Event>(); let event = ev.upcast::<Event>();
event.InitEvent(type_, bubbles, cancelable); event.init_event(type_, bubbles, cancelable);
} }
ev ev
} }
@ -66,7 +67,7 @@ impl MessageEvent {
// Dictionaries need to be rooted // Dictionaries need to be rooted
// https://github.com/servo/servo/issues/6381 // https://github.com/servo/servo/issues/6381
let data = RootedValue::new(global.get_cx(), init.data); let data = RootedValue::new(global.get_cx(), init.data);
let ev = MessageEvent::new(global, type_, init.parent.bubbles, init.parent.cancelable, let ev = MessageEvent::new(global, Atom::from(&*type_), init.parent.bubbles, init.parent.cancelable,
data.handle(), data.handle(),
init.origin.clone(), init.lastEventId.clone()); init.origin.clone(), init.lastEventId.clone());
Ok(ev) Ok(ev)
@ -78,7 +79,7 @@ impl MessageEvent {
scope: GlobalRef, scope: GlobalRef,
message: HandleValue) { message: HandleValue) {
let messageevent = MessageEvent::new( let messageevent = MessageEvent::new(
scope, DOMString::from("message"), false, false, message, scope, atom!("message"), false, false, message,
DOMString::new(), DOMString::new()); DOMString::new(), DOMString::new());
messageevent.upcast::<Event>().fire(target); messageevent.upcast::<Event>().fire(target);
} }

View file

@ -11,6 +11,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root; use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -30,7 +31,7 @@ impl ProgressEvent {
total: total total: total
} }
} }
pub fn new(global: GlobalRef, type_: DOMString, pub fn new(global: GlobalRef, type_: Atom,
can_bubble: EventBubbles, cancelable: EventCancelable, can_bubble: EventBubbles, cancelable: EventCancelable,
length_computable: bool, loaded: u64, total: u64) -> Root<ProgressEvent> { length_computable: bool, loaded: u64, total: u64) -> Root<ProgressEvent> {
let ev = reflect_dom_object(box ProgressEvent::new_inherited(length_computable, loaded, total), let ev = reflect_dom_object(box ProgressEvent::new_inherited(length_computable, loaded, total),
@ -38,7 +39,7 @@ impl ProgressEvent {
ProgressEventBinding::Wrap); ProgressEventBinding::Wrap);
{ {
let event = ev.upcast::<Event>(); let event = ev.upcast::<Event>();
event.InitEvent(type_, can_bubble == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable); event.init_event(type_, can_bubble == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable);
} }
ev ev
} }
@ -49,7 +50,7 @@ impl ProgressEvent {
let bubbles = if init.parent.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble }; let bubbles = if init.parent.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble };
let cancelable = if init.parent.cancelable { EventCancelable::Cancelable } let cancelable = if init.parent.cancelable { EventCancelable::Cancelable }
else { EventCancelable::NotCancelable }; else { EventCancelable::NotCancelable };
let ev = ProgressEvent::new(global, type_, bubbles, cancelable, let ev = ProgressEvent::new(global, Atom::from(&*type_), bubbles, cancelable,
init.lengthComputable, init.loaded, init.total); init.lengthComputable, init.loaded, init.total);
Ok(ev) Ok(ev)
} }

View file

@ -189,7 +189,7 @@ impl MainThreadRunnable for StorageEventRunnable {
let storage_event = StorageEvent::new( let storage_event = StorageEvent::new(
global_ref, global_ref,
DOMString::from("storage"), atom!("storage"),
EventBubbles::DoesNotBubble, EventCancelable::NotCancelable, EventBubbles::DoesNotBubble, EventCancelable::NotCancelable,
this.key.map(DOMString::from), this.old_value.map(DOMString::from), this.new_value.map(DOMString::from), this.key.map(DOMString::from), this.old_value.map(DOMString::from), this.new_value.map(DOMString::from),
DOMString::from(ev_url.to_string()), DOMString::from(ev_url.to_string()),

View file

@ -12,6 +12,7 @@ use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use dom::storage::Storage; use dom::storage::Storage;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -42,7 +43,7 @@ impl StorageEvent {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
key: Option<DOMString>, key: Option<DOMString>,
@ -56,7 +57,7 @@ impl StorageEvent {
StorageEventBinding::Wrap); StorageEventBinding::Wrap);
{ {
let event = ev.upcast::<Event>(); let event = ev.upcast::<Event>();
event.InitEvent(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable); event.init_event(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable);
} }
ev ev
} }
@ -75,7 +76,7 @@ impl StorageEvent {
} else { } else {
EventCancelable::NotCancelable EventCancelable::NotCancelable
}; };
let event = StorageEvent::new(global, type_, let event = StorageEvent::new(global, Atom::from(&*type_),
bubbles, cancelable, bubbles, cancelable,
key, oldValue, newValue, key, oldValue, newValue,
url, storageArea); url, storageArea);

View file

@ -15,6 +15,7 @@ use dom::event::{Event, EventBubbles, EventCancelable};
use dom::window::Window; use dom::window::Window;
use std::cell::Cell; use std::cell::Cell;
use std::default::Default; use std::default::Default;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-UIEvent // https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-UIEvent
@ -91,7 +92,7 @@ impl UIEventMethods for UIEvent {
return; return;
} }
event.InitEvent(type_, can_bubble, cancelable); event.init_event(Atom::from(&*type_), can_bubble, cancelable);
self.view.set(view); self.view.set(view);
self.detail.set(detail); self.detail.set(detail);
} }

View file

@ -12,6 +12,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root; use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -36,7 +37,7 @@ impl WebGLContextEvent {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
type_: DOMString, type_: Atom,
bubbles: EventBubbles, bubbles: EventBubbles,
cancelable: EventCancelable, cancelable: EventCancelable,
status_message: DOMString) -> Root<WebGLContextEvent> { status_message: DOMString) -> Root<WebGLContextEvent> {
@ -47,7 +48,7 @@ impl WebGLContextEvent {
{ {
let parent = event.upcast::<Event>(); let parent = event.upcast::<Event>();
parent.InitEvent(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable); parent.init_event(type_, bubbles == EventBubbles::Bubbles, cancelable == EventCancelable::Cancelable);
} }
event event
@ -73,7 +74,7 @@ impl WebGLContextEvent {
EventCancelable::NotCancelable EventCancelable::NotCancelable
}; };
Ok(WebGLContextEvent::new(global, type_, Ok(WebGLContextEvent::new(global, Atom::from(&*type_),
bubbles, bubbles,
cancelable, cancelable,
status_message)) status_message))

View file

@ -119,7 +119,7 @@ impl WebGLRenderingContext {
Err(msg) => { Err(msg) => {
error!("Couldn't create WebGLRenderingContext: {}", msg); error!("Couldn't create WebGLRenderingContext: {}", msg);
let event = WebGLContextEvent::new(global, let event = WebGLContextEvent::new(global,
DOMString::from("webglcontextcreationerror"), atom!("webglcontextcreationerror"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::Cancelable, EventCancelable::Cancelable,
DOMString::from(msg)); DOMString::from(msg));

View file

@ -464,7 +464,7 @@ impl Runnable for ConnectionEstablishedTask {
// Step 6. // Step 6.
let global = ws.global.root(); let global = ws.global.root();
let event = Event::new(global.r(), DOMString::from("open"), let event = Event::new(global.r(), atom!("open"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(ws.upcast()); event.fire(ws.upcast());
@ -506,7 +506,7 @@ impl Runnable for CloseTask {
//A Bad close //A Bad close
ws.clean_close.set(false); ws.clean_close.set(false);
let event = Event::new(global.r(), let event = Event::new(global.r(),
DOMString::from("error"), atom!("error"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::Cancelable); EventCancelable::Cancelable);
event.fire(ws.upcast()); event.fire(ws.upcast());
@ -516,7 +516,7 @@ impl Runnable for CloseTask {
https://html.spec.whatwg.org/multipage/#closeWebSocket https://html.spec.whatwg.org/multipage/#closeWebSocket
*/ */
let close_event = CloseEvent::new(global.r(), let close_event = CloseEvent::new(global.r(),
DOMString::from("close"), atom!("close"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable, EventCancelable::NotCancelable,
ws.clean_close.get(), ws.clean_close.get(),

View file

@ -128,7 +128,7 @@ impl Worker {
let worker = address.root(); let worker = address.root();
let global = worker.r().global.root(); let global = worker.r().global.root();
let event = Event::new(global.r(), let event = Event::new(global.r(),
DOMString::from("error"), atom!("error"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable); EventCancelable::NotCancelable);
event.fire(worker.upcast()); event.fire(worker.upcast());
@ -139,7 +139,7 @@ impl Worker {
let worker = address.root(); let worker = address.root();
let global = worker.r().global.root(); let global = worker.r().global.root();
let error = RootedValue::new(global.r().get_cx(), UndefinedValue()); let error = RootedValue::new(global.r().get_cx(), UndefinedValue());
let errorevent = ErrorEvent::new(global.r(), DOMString::from("error"), let errorevent = ErrorEvent::new(global.r(), atom!("error"),
EventBubbles::Bubbles, EventCancelable::Cancelable, EventBubbles::Bubbles, EventCancelable::Cancelable,
message, filename, lineno, colno, error.handle()); message, filename, lineno, colno, error.handle());
errorevent.upcast::<Event>().fire(worker.upcast()); errorevent.upcast::<Event>().fire(worker.upcast());

View file

@ -57,6 +57,7 @@ use std::cell::{Cell, RefCell};
use std::default::Default; use std::default::Default;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use string_cache::Atom;
use time; use time;
use timers::{ScheduledCallback, TimerHandle}; use timers::{ScheduledCallback, TimerHandle};
use url::{Url, UrlParser}; use url::{Url, UrlParser};
@ -505,12 +506,12 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
// If one of the event handlers below aborts the fetch by calling // If one of the event handlers below aborts the fetch by calling
// abort or open we will need the current generation id to detect it. // abort or open we will need the current generation id to detect it.
let gen_id = self.generation_id.get(); let gen_id = self.generation_id.get();
self.dispatch_response_progress_event("loadstart".to_owned()); self.dispatch_response_progress_event(atom!("loadstart"));
if self.generation_id.get() != gen_id { if self.generation_id.get() != gen_id {
return Ok(()); return Ok(());
} }
if !self.upload_complete.get() { if !self.upload_complete.get() {
self.dispatch_upload_progress_event("loadstart".to_owned(), Some(0)); self.dispatch_upload_progress_event(atom!("loadstart"), Some(0));
if self.generation_id.get() != gen_id { if self.generation_id.get() != gen_id {
return Ok(()); return Ok(());
} }
@ -775,11 +776,12 @@ pub type TrustedXHRAddress = Trusted<XMLHttpRequest>;
impl XMLHttpRequest { impl XMLHttpRequest {
fn change_ready_state(&self, rs: XMLHttpRequestState) { fn change_ready_state(&self, rs: XMLHttpRequestState) {
use string_cache::Atom;
assert!(self.ready_state.get() != rs); assert!(self.ready_state.get() != rs);
self.ready_state.set(rs); self.ready_state.set(rs);
let global = self.global.root(); let global = self.global.root();
let event = Event::new(global.r(), let event = Event::new(global.r(),
DOMString::from("readystatechange"), atom!("readystatechange"),
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::Cancelable); EventCancelable::Cancelable);
event.fire(self.upcast()); event.fire(self.upcast());
@ -855,11 +857,11 @@ impl XMLHttpRequest {
self.upload_complete.set(true); self.upload_complete.set(true);
// Substeps 2-4 // Substeps 2-4
if !self.sync.get() { if !self.sync.get() {
self.dispatch_upload_progress_event("progress".to_owned(), None); self.dispatch_upload_progress_event(atom!("progress"), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_upload_progress_event("load".to_owned(), None); self.dispatch_upload_progress_event(atom!("load"), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_upload_progress_event("loadend".to_owned(), None); self.dispatch_upload_progress_event(atom!("loadend"), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
} }
// Part of step 13, send() (processing response) // Part of step 13, send() (processing response)
@ -887,7 +889,7 @@ impl XMLHttpRequest {
self.change_ready_state(XMLHttpRequestState::Loading); self.change_ready_state(XMLHttpRequestState::Loading);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
} }
self.dispatch_response_progress_event("progress".to_owned()); self.dispatch_response_progress_event(atom!("progress"));
} }
}, },
XHRProgress::Done(_) => { XHRProgress::Done(_) => {
@ -905,11 +907,11 @@ impl XMLHttpRequest {
self.change_ready_state(XMLHttpRequestState::Done); self.change_ready_state(XMLHttpRequestState::Done);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
// Subsubsteps 10-12 // Subsubsteps 10-12
self.dispatch_response_progress_event("progress".to_owned()); self.dispatch_response_progress_event(atom!("progress"));
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event("load".to_owned()); self.dispatch_response_progress_event(atom!("load"));
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event("loadend".to_owned()); self.dispatch_response_progress_event(atom!("loadend"));
}, },
XHRProgress::Errored(_, e) => { XHRProgress::Errored(_, e) => {
self.cancel_timeout(); self.cancel_timeout();
@ -929,18 +931,18 @@ impl XMLHttpRequest {
let upload_complete = &self.upload_complete; let upload_complete = &self.upload_complete;
if !upload_complete.get() { if !upload_complete.get() {
upload_complete.set(true); upload_complete.set(true);
self.dispatch_upload_progress_event("progress".to_owned(), None); self.dispatch_upload_progress_event(atom!("progress"), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_upload_progress_event(errormsg.to_owned(), None); self.dispatch_upload_progress_event(Atom::from(errormsg), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_upload_progress_event("loadend".to_owned(), None); self.dispatch_upload_progress_event(atom!("loadend"), None);
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
} }
self.dispatch_response_progress_event("progress".to_owned()); self.dispatch_response_progress_event(atom!("progress"));
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event(errormsg.to_owned()); self.dispatch_response_progress_event(Atom::from(errormsg));
return_if_fetch_was_terminated!(); return_if_fetch_was_terminated!();
self.dispatch_response_progress_event("loadend".to_owned()); self.dispatch_response_progress_event(atom!("loadend"));
} }
} }
} }
@ -957,10 +959,10 @@ impl XMLHttpRequest {
self.request_headers.borrow_mut().set_raw(name, vec![value.into_bytes()]); self.request_headers.borrow_mut().set_raw(name, vec![value.into_bytes()]);
} }
fn dispatch_progress_event(&self, upload: bool, type_: String, loaded: u64, total: Option<u64>) { fn dispatch_progress_event(&self, upload: bool, type_: Atom, loaded: u64, total: Option<u64>) {
let global = self.global.root(); let global = self.global.root();
let progressevent = ProgressEvent::new(global.r(), let progressevent = ProgressEvent::new(global.r(),
DOMString::from(type_), type_,
EventBubbles::DoesNotBubble, EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable, EventCancelable::NotCancelable,
total.is_some(), loaded, total.is_some(), loaded,
@ -973,14 +975,14 @@ impl XMLHttpRequest {
progressevent.upcast::<Event>().fire(target); progressevent.upcast::<Event>().fire(target);
} }
fn dispatch_upload_progress_event(&self, type_: String, partial_load: Option<u64>) { fn dispatch_upload_progress_event(&self, type_: Atom, partial_load: Option<u64>) {
// If partial_load is None, loading has completed and we can just use the value from the request body // If partial_load is None, loading has completed and we can just use the value from the request body
let total = self.request_body_len.get() as u64; let total = self.request_body_len.get() as u64;
self.dispatch_progress_event(true, type_, partial_load.unwrap_or(total), Some(total)); self.dispatch_progress_event(true, type_, partial_load.unwrap_or(total), Some(total));
} }
fn dispatch_response_progress_event(&self, type_: String) { fn dispatch_response_progress_event(&self, type_: Atom) {
let len = self.response.borrow().len() as u64; let len = self.response.borrow().len() as u64;
let total = self.response_headers.borrow().get::<ContentLength>().map(|x| { **x as u64 }); let total = self.response_headers.borrow().get::<ContentLength>().map(|x| { **x as u64 });
self.dispatch_progress_event(false, type_, len, total); self.dispatch_progress_event(false, type_, len, total);

View file

@ -635,7 +635,7 @@ dependencies = [
"servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)", "servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)",
"simd 0.1.0 (git+https://github.com/huonw/simd)", "simd 0.1.0 (git+https://github.com/huonw/simd)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -798,7 +798,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -958,7 +958,7 @@ dependencies = [
"serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1521,7 +1521,7 @@ dependencies = [
"selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1577,7 +1577,7 @@ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1747,7 +1747,7 @@ dependencies = [
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.2.2" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1777,7 +1777,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1", "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
@ -1792,7 +1792,7 @@ dependencies = [
"euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1960,7 +1960,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2125,7 +2125,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

18
ports/cef/Cargo.lock generated
View file

@ -602,7 +602,7 @@ dependencies = [
"servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)", "servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)",
"simd 0.1.0 (git+https://github.com/huonw/simd)", "simd 0.1.0 (git+https://github.com/huonw/simd)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -758,7 +758,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -918,7 +918,7 @@ dependencies = [
"serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1446,7 +1446,7 @@ dependencies = [
"selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1493,7 +1493,7 @@ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1699,7 +1699,7 @@ dependencies = [
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.2.2" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1729,7 +1729,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1", "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
@ -1896,7 +1896,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2050,7 +2050,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

18
ports/gonk/Cargo.lock generated
View file

@ -600,7 +600,7 @@ dependencies = [
"servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)", "servo-skia 0.20130412.2 (registry+https://github.com/rust-lang/crates.io-index)",
"simd 0.1.0 (git+https://github.com/huonw/simd)", "simd 0.1.0 (git+https://github.com/huonw/simd)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -734,7 +734,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -894,7 +894,7 @@ dependencies = [
"serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1422,7 +1422,7 @@ dependencies = [
"selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1", "style 0.0.1",
"style_traits 0.0.1", "style_traits 0.0.1",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1469,7 +1469,7 @@ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quickersort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1673,7 +1673,7 @@ dependencies = [
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.2.2" version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1703,7 +1703,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1", "style_traits 0.0.1",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
@ -1870,7 +1870,7 @@ dependencies = [
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1994,7 +1994,7 @@ dependencies = [
"phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
] ]