beforeunload and unload infrastructure

This commit is contained in:
Gregory Terzian 2018-03-18 13:20:24 +08:00
parent a1d1b18710
commit 427eaed535
28 changed files with 267 additions and 60 deletions

View file

@ -482,7 +482,14 @@ fn invoke(window: Option<&Window>,
event.current_target.set(Some(object));
// Step 5.
inner_invoke(window, object, event, &listeners);
if inner_invoke(window, object, event, &listeners) {
// <https://html.spec.whatwg.org/multipage/#unload-a-document>
// Step 9.
// Required to establish the 'salvageable' state of document as part of unloading.
if event.canceled.get() != EventDefault::Prevented {
event.mark_as_handled();
}
}
// TODO: step 6.
}