mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Adding window.onstorage EventHandler
This commit is contained in:
parent
417cf5738e
commit
a183eacb63
3 changed files with 16 additions and 0 deletions
|
@ -83,6 +83,18 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
|
||||||
let win = window_from_node(self);
|
let win = window_from_node(self);
|
||||||
win.r().SetOnunload(listener)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ interface GlobalEventHandlers {
|
||||||
[NoInterfaceObject]
|
[NoInterfaceObject]
|
||||||
interface WindowEventHandlers {
|
interface WindowEventHandlers {
|
||||||
attribute EventHandler onunload;
|
attribute EventHandler onunload;
|
||||||
|
attribute EventHandler onstorage;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The spec has |attribute OnErrorEventHandler onerror;| on
|
// The spec has |attribute OnErrorEventHandler onerror;| on
|
||||||
|
|
|
@ -513,6 +513,9 @@ impl WindowMethods for Window {
|
||||||
// https://html.spec.whatwg.org/multipage/#handler-window-onunload
|
// https://html.spec.whatwg.org/multipage/#handler-window-onunload
|
||||||
event_handler!(unload, GetOnunload, SetOnunload);
|
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
|
// https://html.spec.whatwg.org/multipage/#handler-onerror
|
||||||
error_event_handler!(error, GetOnerror, SetOnerror);
|
error_event_handler!(error, GetOnerror, SetOnerror);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue