Implement From<DOMString> for Atom

This commit is contained in:
Anthony Ramine 2016-02-24 17:28:24 +01:00
parent f7fb035188
commit 0adfb08089
20 changed files with 44 additions and 38 deletions

View file

@ -96,7 +96,7 @@ impl Event {
init: &EventBinding::EventInit) -> Fallible<Root<Event>> {
let bubbles = if init.bubbles { EventBubbles::Bubbles } else { EventBubbles::DoesNotBubble };
let cancelable = if init.cancelable { EventCancelable::Cancelable } else { EventCancelable::NotCancelable };
Ok(Event::new(global, Atom::from(&*type_), bubbles, cancelable))
Ok(Event::new(global, Atom::from(type_), bubbles, cancelable))
}
pub fn init_event(&self, type_: Atom, bubbles: bool, cancelable: bool) {
@ -240,7 +240,7 @@ impl EventMethods for Event {
type_: DOMString,
bubbles: bool,
cancelable: bool) {
self.init_event(Atom::from(&*type_), bubbles, cancelable)
self.init_event(Atom::from(type_), bubbles, cancelable)
}
// https://dom.spec.whatwg.org/#dom-event-istrusted