Auto merge of #8038 - martiansideofthemoon:my-code-fix, r=jdm

Adding window.onstorage WindowEventHandler

Well it built successfully this time around 😄 @jdm . Working to solve #7994

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8038)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-17 22:36:13 -06:00
commit 23fa9de714
4 changed files with 16 additions and 6 deletions

View file

@ -83,6 +83,18 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
let win = window_from_node(self);
win.r().SetOnunload(listener)
}
// https://html.spec.whatwg.org/multipage/#the-body-element
fn GetOnstorage(&self) -> Option<Rc<EventHandlerNonNull>> {
let win = window_from_node(self);
win.r().GetOnstorage()
}
// https://html.spec.whatwg.org/multipage/#the-body-element
fn SetOnstorage(&self, listener: Option<Rc<EventHandlerNonNull>>) {
let win = window_from_node(self);
win.r().SetOnstorage(listener)
}
}

View file

@ -36,6 +36,7 @@ interface GlobalEventHandlers {
[NoInterfaceObject]
interface WindowEventHandlers {
attribute EventHandler onunload;
attribute EventHandler onstorage;
};
// The spec has |attribute OnErrorEventHandler onerror;| on

View file

@ -513,6 +513,9 @@ impl WindowMethods for Window {
// https://html.spec.whatwg.org/multipage/#handler-window-onunload
event_handler!(unload, GetOnunload, SetOnunload);
// https://html.spec.whatwg.org/multipage/#handler-window-onstorage
event_handler!(storage, GetOnstorage, SetOnstorage);
// https://html.spec.whatwg.org/multipage/#handler-onerror
error_event_handler!(error, GetOnerror, SetOnerror);