mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
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:
commit
23fa9de714
4 changed files with 16 additions and 6 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ interface GlobalEventHandlers {
|
|||
[NoInterfaceObject]
|
||||
interface WindowEventHandlers {
|
||||
attribute EventHandler onunload;
|
||||
attribute EventHandler onstorage;
|
||||
};
|
||||
|
||||
// The spec has |attribute OnErrorEventHandler onerror;| on
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue