Implement history state

This commit is contained in:
Connor Brewster 2018-04-14 01:53:11 -05:00
parent e4472f7c1f
commit 17bd80a7b1
55 changed files with 316 additions and 359 deletions

View file

@ -12,6 +12,7 @@ use dom::bindings::root::DomRoot;
use dom::bindings::str::DOMString;
use dom::bindings::trace::RootedTraceableBox;
use dom::event::Event;
use dom::eventtarget::EventTarget;
use dom::window::Window;
use dom_struct::dom_struct;
use js::jsapi::{Heap, JSContext};
@ -66,6 +67,13 @@ impl PopStateEvent {
init.parent.cancelable,
init.state.handle()))
}
pub fn dispatch_jsval(target: &EventTarget,
window: &Window,
state: HandleValue) {
let event = PopStateEvent::new(window, atom!("popstate"), true, false, state);
event.upcast::<Event>().fire(target);
}
}
impl PopStateEventMethods for PopStateEvent {