Migrate EventTarget event firing functions to use Atoms.

This allows us to utilize more `atom` macros.
This commit is contained in:
Corey Farwell 2016-11-02 23:49:52 -04:00
parent 80575c3d2e
commit f447040ea9
16 changed files with 42 additions and 33 deletions

View file

@ -18,6 +18,7 @@ use dom::globalscope::GlobalScope;
use js::jsapi::{HandleValue, JSContext};
use script_thread::Runnable;
use script_traits::{ScriptMsg, DOMMessage};
use servo_atoms::Atom;
use std::cell::Cell;
use url::Url;
@ -56,12 +57,12 @@ impl ServiceWorker {
pub fn dispatch_simple_error(address: TrustedServiceWorkerAddress) {
let service_worker = address.root();
service_worker.upcast().fire_event("error");
service_worker.upcast().fire_event(atom!("error"));
}
pub fn set_transition_state(&self, state: ServiceWorkerState) {
self.state.set(state);
self.upcast::<EventTarget>().fire_event("statechange");
self.upcast::<EventTarget>().fire_event(Atom::from("statechange"));
}
pub fn get_script_url(&self) -> Url {