mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
beforeunload and unload infrastructure
This commit is contained in:
parent
a1d1b18710
commit
427eaed535
28 changed files with 267 additions and 60 deletions
|
@ -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.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue